import { AccountContext } from '@components/accountProvider'; import { RelayContext } from '@components/relaysProvider'; import Tooltip from '@components/tooltip'; import { MESSAGE_RELAYS } from '@stores/constants'; import { dateToUnix } from '@utils/getDate'; import { MicMute } from 'iconoir-react'; import { getEventHash, signEvent } from 'nostr-tools'; import { useContext } from 'react'; export const MuteButton = ({ pubkey }: { pubkey: string }) => { const pool: any = useContext(RelayContext); const activeAccount: any = useContext(AccountContext); const muteUser = () => { const event: any = { content: '', created_at: dateToUnix(), kind: 44, pubkey: activeAccount.pubkey, tags: [['p', pubkey]], }; event.id = getEventHash(event); event.sig = signEvent(event, activeAccount.privkey); // publish note pool.publish(event, MESSAGE_RELAYS); }; return ( ); };