22 lines
518 B
TypeScript
22 lines
518 B
TypeScript
|
import { HexKey } from "Nostr";
|
||
|
import useModeration from "Hooks/useModeration";
|
||
|
|
||
|
interface MuteButtonProps {
|
||
|
pubkey: HexKey
|
||
|
}
|
||
|
|
||
|
const MuteButton = ({ pubkey }: MuteButtonProps) => {
|
||
|
const { mute, unmute, isMuted } = useModeration()
|
||
|
return isMuted(pubkey) ? (
|
||
|
<button className="secondary" type="button" onClick={() => unmute(pubkey)}>
|
||
|
Unmute
|
||
|
</button>
|
||
|
) : (
|
||
|
<button className="secondary" type="button" onClick={() => mute(pubkey)}>
|
||
|
Mute
|
||
|
</button>
|
||
|
)
|
||
|
}
|
||
|
|
||
|
export default MuteButton
|