2023-12-02 05:53:43 +01:00
|
|
|
import emojify from '@/utils/emojify'
|
2024-01-09 13:30:05 +01:00
|
|
|
import { Avatar } from '@material-tailwind/react'
|
2023-12-02 05:53:43 +01:00
|
|
|
import { Entity } from 'megalodon'
|
|
|
|
import { useRouter } from 'next/router'
|
|
|
|
|
|
|
|
type Props = {
|
|
|
|
user: Entity.Account
|
|
|
|
}
|
|
|
|
|
|
|
|
export default function User(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 (
|
2024-03-14 17:12:19 +01:00
|
|
|
<div className="border-b border-gray-200 dark:border-gray-700 mr-2 py-1">
|
2023-12-02 05:53:43 +01:00
|
|
|
<div className="flex" onClick={() => openUser(props.user.id)}>
|
|
|
|
<div className="p2 cursor-pointer" style={{ width: '56px' }}>
|
2024-01-09 13:30:05 +01:00
|
|
|
<Avatar src={props.user.avatar} />
|
2023-12-02 05:53:43 +01:00
|
|
|
</div>
|
|
|
|
<div>
|
2024-03-14 17:12:19 +01:00
|
|
|
<p
|
|
|
|
className="text-gray-800 dark:text-gray-200"
|
|
|
|
dangerouslySetInnerHTML={{ __html: emojify(props.user.display_name, props.user.emojis) }}
|
|
|
|
/>
|
2023-12-02 05:53:43 +01:00
|
|
|
<p className="text-gray-500">@{props.user.acct}</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|