mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-23 18:31:12 -05:00
feat: Implement Novu subscriber update
This commit is contained in:
@@ -18,7 +18,6 @@ interface LockStatusDisplayProps {
|
||||
currentLock: LockState | null;
|
||||
queueStats: QueueStats | null;
|
||||
isLoading: boolean;
|
||||
onClaimNext: () => Promise<void>;
|
||||
onExtendLock: (submissionId: string) => Promise<boolean>;
|
||||
onReleaseLock: (submissionId: string) => Promise<boolean>;
|
||||
getTimeRemaining: () => number | null;
|
||||
@@ -35,7 +34,6 @@ export const LockStatusDisplay = ({
|
||||
currentLock,
|
||||
queueStats,
|
||||
isLoading,
|
||||
onClaimNext,
|
||||
onExtendLock,
|
||||
onReleaseLock,
|
||||
getTimeRemaining,
|
||||
@@ -51,19 +49,13 @@ export const LockStatusDisplay = ({
|
||||
const timeRemaining = getTimeRemaining();
|
||||
const showExtendButton = timeRemaining !== null && timeRemaining < 5 * 60 * 1000;
|
||||
|
||||
// No active lock - show claim button
|
||||
// If no active lock, show simple info message
|
||||
if (!currentLock) {
|
||||
return (
|
||||
<div className="flex flex-col gap-2 min-w-[200px]">
|
||||
<Button
|
||||
size="lg"
|
||||
onClick={onClaimNext}
|
||||
disabled={isLoading || (queueStats?.pendingCount === 0)}
|
||||
className="w-full"
|
||||
>
|
||||
<Lock className="w-4 h-4 mr-2" />
|
||||
Claim Next Submission
|
||||
</Button>
|
||||
<div className="text-sm text-muted-foreground">
|
||||
No submission currently claimed. Claim a submission below to start reviewing.
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -132,7 +132,6 @@ export const ModerationQueue = forwardRef<ModerationQueueRef>((props, ref) => {
|
||||
currentLock={queueManager.queue.currentLock}
|
||||
queueStats={queueManager.queue.queueStats}
|
||||
isLoading={queueManager.queue.isLoading}
|
||||
onClaimNext={async () => { await queueManager.queue.claimNext(); }}
|
||||
onExtendLock={queueManager.queue.extendLock}
|
||||
onReleaseLock={queueManager.queue.releaseLock}
|
||||
getTimeRemaining={queueManager.queue.getTimeRemaining}
|
||||
|
||||
@@ -101,8 +101,13 @@ export const QueueItem = memo(({
|
||||
|
||||
const handleClaim = useCallback(async () => {
|
||||
setIsClaiming(true);
|
||||
await onClaimSubmission(item.id);
|
||||
setIsClaiming(false);
|
||||
try {
|
||||
await onClaimSubmission(item.id);
|
||||
// On success, component will re-render with new lock state
|
||||
} catch (error) {
|
||||
console.error('Failed to claim submission:', error);
|
||||
setIsClaiming(false);
|
||||
}
|
||||
}, [onClaimSubmission, item.id]);
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user