2024-04-22 13:38:14 +00:00
|
|
|
import { HexKey, NostrPrefix } from "@snort/system";
|
2024-01-04 17:01:18 +00:00
|
|
|
import { FormattedMessage } from "react-intl";
|
|
|
|
|
2024-01-04 13:48:19 +00:00
|
|
|
import MuteButton from "@/Components/User/MuteButton";
|
|
|
|
import ProfilePreview from "@/Components/User/ProfilePreview";
|
2023-11-17 11:52:10 +00:00
|
|
|
import useModeration from "@/Hooks/useModeration";
|
2023-01-26 11:34:18 +00:00
|
|
|
|
2023-09-28 09:26:10 +00:00
|
|
|
import messages from "../messages";
|
2023-02-08 21:10:26 +00:00
|
|
|
|
2023-01-26 11:34:18 +00:00
|
|
|
export interface MutedListProps {
|
2023-02-10 11:12:11 +00:00
|
|
|
pubkeys: HexKey[];
|
2023-01-26 11:34:18 +00:00
|
|
|
}
|
|
|
|
|
2024-04-22 13:38:14 +00:00
|
|
|
export default function MutedList() {
|
|
|
|
const { muteList } = useModeration();
|
2023-01-26 11:34:18 +00:00
|
|
|
|
2023-02-07 20:04:50 +00:00
|
|
|
return (
|
2023-10-31 15:40:12 +00:00
|
|
|
<div className="p">
|
2023-10-17 13:02:59 +00:00
|
|
|
<div className="flex justify-between">
|
2023-09-25 12:59:31 +00:00
|
|
|
<div className="bold">
|
2024-04-22 13:38:14 +00:00
|
|
|
<FormattedMessage {...messages.MuteCount} values={{ n: muteList?.length }} />
|
2023-02-08 21:10:26 +00:00
|
|
|
</div>
|
2023-02-07 20:04:50 +00:00
|
|
|
</div>
|
2024-04-22 13:38:14 +00:00
|
|
|
{muteList?.map(a => {
|
|
|
|
switch (a.type) {
|
|
|
|
case NostrPrefix.Profile:
|
|
|
|
case NostrPrefix.PublicKey: {
|
|
|
|
return (
|
|
|
|
<ProfilePreview
|
|
|
|
actions={<MuteButton pubkey={a.id} />}
|
|
|
|
pubkey={a.id}
|
|
|
|
options={{ about: false }}
|
|
|
|
key={a.id}
|
|
|
|
/>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return undefined;
|
2023-02-07 20:04:50 +00:00
|
|
|
})}
|
|
|
|
</div>
|
|
|
|
);
|
2023-01-26 11:34:18 +00:00
|
|
|
}
|