import { DEFAULT_AVATAR } from '@lume/stores/constants'; import { useProfile } from '@lume/utils/hooks/useProfile'; import { shortenKey } from '@lume/utils/shortenKey'; import { useState } from 'react'; export const UserMuted = ({ data }: { data: any }) => { const profile = useProfile(data.content); const [status, setStatus] = useState(data.status); const unmute = async () => { const { updateItemInBlacklist } = await import('@lume/utils/storage'); const res = await updateItemInBlacklist(data.content, 0); if (res) { setStatus(0); } }; const mute = async () => { const { updateItemInBlacklist } = await import('@lume/utils/storage'); const res = await updateItemInBlacklist(data.content, 1); if (res) { setStatus(1); } }; return (
{data.content}
{profile?.display_name || profile?.name} {shortenKey(data.content)}
{status === 1 ? ( ) : ( )}
); };