import { Entity, MegalodonInterface } from 'megalodon' import { useEffect, useState } from 'react' import { Virtuoso } from 'react-virtuoso' import Status from '../timelines/status/Status' import { Account } from '@/db' type Props = { client: MegalodonInterface account: Account status_id: string openMedia: (media: Array, index: number) => void } export default function Thread(props: Props) { const [ancestors, setAncestors] = useState>([]) const [descendants, setDescendants] = useState>([]) const [status, setStatus] = useState(null) useEffect(() => { if (props.status_id) { const f = async () => { const s = await props.client.getStatus(props.status_id) setStatus(s.data) const res = await props.client.getStatusContext(props.status_id) setAncestors(res.data.ancestors) setDescendants(res.data.descendants) } f() } }, [props.status_id]) return ( <> s !== null)} itemContent={(_, status) => ( {}} openMedia={props.openMedia} filters={[]} /> )} /> ) }