import { Avatar, Spinner } from '@material-tailwind/react' import { Entity } from 'megalodon' import emojify from '@/utils/emojify' import { useRouter } from 'next/router' type Props = { users: Array loading: boolean } export default function Accounts(props: Props) { const router = useRouter() const openUser = (id: string) => { router.push({ query: { id: router.query.id, timeline: router.query.timeline, user_id: id, detail: true } }) } return ( <>
{props.users.length > 0 ? ( <> {props.users.map((user, index) => ( ))} ) : ( <> {props.loading && (
)} )}
) } type UserProps = { user: Entity.Account openUser: (id: string) => void } function User(props: UserProps) { return (
props.openUser(props.user.id)}>

@{props.user.acct}

) }