import { useArk } from "@lume/ark"; import { LoaderIcon } from "@lume/icons"; import { cn } from "@lume/utils"; import { useEffect, useState } from "react"; import { useTranslation } from "react-i18next"; import { ReplyForm } from "./editor/replyForm"; import { Reply } from "./note/primitives/reply"; import { EventWithReplies } from "@lume/types"; export function ReplyList({ eventId, className, }: { eventId: string; className?: string; }) { const ark = useArk(); const [t] = useTranslation(); const [data, setData] = useState(null); useEffect(() => { async function getReplies() { const events = await ark.get_event_thread(eventId); setData(events); } getReplies(); }, [eventId]); return (
{!data ? (
) : data.length === 0 ? (

👋

{t("note.reply.empty")}

) : ( data.map((event) => ) )}
); }