import type { EventWithReplies } from "@lume/types"; import { Spinner } from "@lume/ui"; import { cn } from "@lume/utils"; import { useEffect, useState } from "react"; import { useTranslation } from "react-i18next"; import { Reply } from "./reply"; import { LumeEvent } from "@lume/system"; export function ReplyList({ eventId, className, }: { eventId: string; className?: string; }) { const [t] = useTranslation(); const [data, setData] = useState(null); useEffect(() => { async function getReplies() { const events = await LumeEvent.getReplies(eventId); setData(events); } getReplies(); }, [eventId]); return (
Replies ({data?.length ?? 0})
{!data ? (
) : data.length === 0 ? (

👋

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

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