diff --git a/components/modals/user-moderation-modal.tsx b/components/modals/user-moderation-modal.tsx
index 827f3b1..a7008ee 100644
--- a/components/modals/user-moderation-modal.tsx
+++ b/components/modals/user-moderation-modal.tsx
@@ -10,6 +10,7 @@ import { ProfileViewBasic } from '@atproto/api/dist/client/types/app/bsky/actor/
import { checkUserBanStatus, banUser, unbanUser, BannedFromTV, checkUserMuteStatus, muteUser, unmuteUser, fetchProfileModerationData, emitModerationEvent } from '@/repos/moderation';
import { ToastContext } from '@/contexts/toast-context';
import { ProfileModerationResponse, ModerationEventType, EscalatedItem, EscalatedPostItem } from '@/lib/types/moderation';
+import { BLACKSKY_PDS_URL } from '@/lib/constants/moderation';
import { getPostUrl } from '@/components/post/utils';
type UserLike = {
@@ -410,6 +411,70 @@ export const UserModerationModal = ({
}
};
+ // Check if user is on blacksky.app PDS (required for takedown actions)
+ const isBlackskyUser = moderationData?.pdsEndpoint === BLACKSKY_PDS_URL;
+
+ // Quick action handlers
+ const handleQuickAcknowledge = async () => {
+ setOzoneAction(prev => ({ ...prev, type: 'acknowledge', loading: true }));
+
+ try {
+ const isEscalatedPost = 'type' in user && user.type === 'post';
+ const subjectUri = isEscalatedPost ? (user as EscalatedPostItem).postUri : undefined;
+ const subjectCid = isEscalatedPost ? (user as EscalatedPostItem).postCid : undefined;
+
+ const result = await emitModerationEvent(user.did, 'acknowledge', {}, subjectUri, subjectCid);
+
+ toastContext?.toast({
+ title: 'Success',
+ message: result.message || 'Successfully acknowledged',
+ intent: VisualIntent.Success,
+ });
+
+ resetOzoneAction();
+ await refreshModerationData();
+ } catch (error) {
+ console.error('Failed to acknowledge:', error);
+ toastContext?.toast({
+ title: 'Error',
+ message: error instanceof Error ? error.message : 'Failed to acknowledge',
+ intent: VisualIntent.Error,
+ });
+ } finally {
+ setOzoneAction(prev => ({ ...prev, loading: false }));
+ }
+ };
+
+ const handleQuickTakedown = async () => {
+ setOzoneAction(prev => ({ ...prev, type: 'takedown', loading: true }));
+
+ try {
+ const isEscalatedPost = 'type' in user && user.type === 'post';
+ const subjectUri = isEscalatedPost ? (user as EscalatedPostItem).postUri : undefined;
+ const subjectCid = isEscalatedPost ? (user as EscalatedPostItem).postCid : undefined;
+
+ const result = await emitModerationEvent(user.did, 'takedown', {}, subjectUri, subjectCid);
+
+ toastContext?.toast({
+ title: 'Success',
+ message: result.message || 'Successfully taken down',
+ intent: VisualIntent.Success,
+ });
+
+ resetOzoneAction();
+ await refreshModerationData();
+ } catch (error) {
+ console.error('Failed to takedown:', error);
+ toastContext?.toast({
+ title: 'Error',
+ message: error instanceof Error ? error.message : 'Failed to takedown',
+ intent: VisualIntent.Error,
+ });
+ } finally {
+ setOzoneAction(prev => ({ ...prev, loading: false }));
+ }
+ };
+
return (
+ {moderationData.pdsEndpoint} +
+ )} {'type' in user && user.type === 'post' && 'postUri' in user && ( - {muteStatus.isMuted ? 'Greenlist Unmute' : 'Greenlist Mute'} + {muteStatus.isMuted ? 'Ungreenlist' : 'Greenlist'} @@ -576,7 +646,24 @@ export const UserModerationModal = ({ {/* Ozone Actions Section */}