"use client" import { useEffect, useState, useTransition } from "react" import { Post } from "@/types" import { cn } from "@/lib/utils" import { actionman } from "@/lib/fonts" import { useSearchParams } from "next/navigation" import { Button } from "@/components/ui/button" import { Delete } from "./delete" import Link from "next/link" import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@/components/ui/tooltip" import { getLatestPosts } from "@/app/server/actions/community" export default function FirehosePage() { const searchParams = useSearchParams() const [_isPending, startTransition] = useTransition() const [posts, setPosts] = useState([]) const moderationKey = (searchParams.get("moderationKey") as string) || "" const [toDelete, setToDelete] = useState() useEffect(() => { startTransition(async () => { const newPosts = await getLatestPosts({ maxNbPosts: 200, shuffle: false, }) setPosts(newPosts) }) }, []) const handleOnDelete = ({ postId }: Post) => { setPosts(posts.filter(post => post.postId !== postId)) setToDelete(undefined) } return (

AI Clip Factory

{posts.map(post => (
{post.prompt}

{post.prompt}

{new Date(Date.parse(post.createdAt)).toLocaleString()}
{moderationKey ?
: null}
))}
) }