mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-20 17:31:13 -05:00
feat: Extract type definitions
This commit is contained in:
@@ -33,62 +33,22 @@ import { smartMergeArray } from '@/lib/smartStateUpdate';
|
||||
import { useDebounce } from '@/hooks/useDebounce';
|
||||
import { QueueItem } from './QueueItem';
|
||||
import { QueueSkeleton } from './QueueSkeleton';
|
||||
|
||||
interface ModerationItem {
|
||||
id: string;
|
||||
type: 'review' | 'content_submission';
|
||||
content: any;
|
||||
created_at: string;
|
||||
updated_at?: string;
|
||||
user_id: string;
|
||||
status: string;
|
||||
submission_type?: string;
|
||||
user_profile?: {
|
||||
username: string;
|
||||
display_name?: string;
|
||||
avatar_url?: string;
|
||||
};
|
||||
entity_name?: string;
|
||||
park_name?: string;
|
||||
reviewed_at?: string;
|
||||
reviewed_by?: string;
|
||||
reviewer_notes?: string;
|
||||
reviewer_profile?: {
|
||||
username: string;
|
||||
display_name?: string;
|
||||
avatar_url?: string;
|
||||
};
|
||||
escalated?: boolean;
|
||||
assigned_to?: string;
|
||||
locked_until?: string;
|
||||
_removing?: boolean;
|
||||
submission_items?: Array<{
|
||||
id: string;
|
||||
item_type: string;
|
||||
item_data: any;
|
||||
status: string;
|
||||
}>;
|
||||
}
|
||||
|
||||
type EntityFilter = 'all' | 'reviews' | 'submissions' | 'photos';
|
||||
type StatusFilter = 'all' | 'pending' | 'partially_approved' | 'flagged' | 'approved' | 'rejected';
|
||||
type QueueTab = 'mainQueue' | 'archive';
|
||||
type SortField = 'created_at' | 'username' | 'submission_type' | 'status' | 'escalated';
|
||||
type SortDirection = 'asc' | 'desc';
|
||||
|
||||
interface SortConfig {
|
||||
field: SortField;
|
||||
direction: SortDirection;
|
||||
}
|
||||
|
||||
export interface ModerationQueueRef {
|
||||
refresh: () => void;
|
||||
}
|
||||
import type {
|
||||
ModerationItem,
|
||||
EntityFilter,
|
||||
StatusFilter,
|
||||
QueueTab,
|
||||
SortField,
|
||||
SortDirection,
|
||||
SortConfig,
|
||||
LoadingState,
|
||||
ModerationQueueRef,
|
||||
} from '@/types/moderation';
|
||||
|
||||
export const ModerationQueue = forwardRef<ModerationQueueRef>((props, ref) => {
|
||||
const isMobile = useIsMobile();
|
||||
const [items, setItems] = useState<ModerationItem[]>([]);
|
||||
const [loadingState, setLoadingState] = useState<'initial' | 'loading' | 'refreshing' | 'ready'>('initial');
|
||||
const [loadingState, setLoadingState] = useState<LoadingState>('initial');
|
||||
const [actionLoading, setActionLoading] = useState<string | null>(null);
|
||||
const [notes, setNotes] = useState<Record<string, string>>({});
|
||||
const [activeTab, setActiveTab] = useState<QueueTab>('mainQueue');
|
||||
@@ -2519,3 +2479,6 @@ export const ModerationQueue = forwardRef<ModerationQueueRef>((props, ref) => {
|
||||
});
|
||||
|
||||
ModerationQueue.displayName = 'ModerationQueue';
|
||||
|
||||
// Re-export types for backwards compatibility
|
||||
export type { ModerationQueueRef } from '@/types/moderation';
|
||||
|
||||
Reference in New Issue
Block a user