import NextLink from "next/link" import VisibilityBadge from "../badges/visibility-badge" import { Text, Card, Tooltip, Divider, Badge, Button } from "@geist-ui/core/dist" import { File, Post } from "@lib/types" import FadeIn from "@components/fade-in" import Trash from "@geist-ui/icons/trash" import ExpirationBadge from "@components/badges/expiration-badge" import CreatedAgoBadge from "@components/badges/created-ago-badge" import Edit from "@geist-ui/icons/edit" import { useRouter } from "next/router" import Parent from "@geist-ui/icons/arrowUpCircle" import styles from "./list-item.module.css" import Link from "@components/link" // TODO: isOwner should default to false so this can be used generically const ListItem = ({ post, isOwner = true, deletePost }: { post: Post isOwner?: boolean deletePost: () => void }) => { const router = useRouter() const editACopy = () => { router.push(`/new/from/${post.id}`) } const viewParentClick = () => { router.push(`/post/${post.parent?.id}`) } return (
  • {post.title} {isOwner && ( {post.parent && (
  • {" "}
    ) } export default ListItem