import { Entity, MegalodonInterface } from 'megalodon' import dayjs from 'dayjs' import emojify from '@/utils/emojify' import Body from '../status/Body' import Poll from '../status/Poll' import Card from '../status/Card' import Media from '../status/Media' import { FaBarsProgress, FaHouse, FaPenToSquare, FaRetweet, FaStar } from 'react-icons/fa6' import { useIntl } from 'react-intl' import { useState } from 'react' import { Avatar } from '@material-tailwind/react' import { useRouter } from 'next/router' type Props = { notification: Entity.Notification client: MegalodonInterface onRefresh: (status: Entity.Status) => void openMedia: (media: Entity.Attachment) => void } export default function Reaction(props: Props) { const status = props.notification.status const [spoilered, setSpoilered] = useState(status.spoiler_text.length > 0) const { formatMessage } = useIntl() const router = useRouter() const refresh = async () => { const res = await props.client.getStatus(status.id) props.onRefresh(res.data) } const openStatus = () => { router.push({ query: { id: router.query.id, timeline: router.query.timeline, status_id: status.id, detail: true } }) } const openUser = (id: string) => { router.push({ query: { id: router.query.id, timeline: router.query.timeline, user_id: id, detail: true } }) } return (