import { Card, Spacer, Grid, Divider, Link, Text, Input, Tooltip } from "@geist-ui/core" import NextLink from "next/link" import { useEffect, useMemo, useState } from "react" import timeAgo from "@lib/time-ago" import ShiftBy from "../shift-by" import VisibilityBadge from "../visibility-badge" import getPostPath from "@lib/get-post-path" const FilenameInput = ({ title }: { title: string }) => const ListItem = ({ post }: { post: any }) => { const createdDate = useMemo(() => new Date(post.createdAt), [post.createdAt]) const [time, setTimeAgo] = useState(timeAgo(createdDate)) useEffect(() => { const interval = setInterval(() => { setTimeAgo(timeAgo(createdDate)) }, 10000) return () => clearInterval(interval) }, [createdDate]) const formattedTime = `${createdDate.toLocaleDateString()} ${createdDate.toLocaleTimeString()}` return (
  • {post.title} {time} {post.files.length === 1 ? "1 file" : `${post.files.length} files`} {post.files.map((file: any) => { return })}
  • ) } export default ListItem