added unapprove
Deploy / deploy (push) Successful in 2m37s

This commit is contained in:
twotalesanimation
2026-06-11 15:19:12 +02:00
parent 7b9bbbec16
commit b640fa472c
5 changed files with 361 additions and 2 deletions
@@ -29,7 +29,7 @@ import {
import type { ShotWithDetails } from "@/types";
import { ShotSettingsTab } from "@/components/shots/ShotSettingsTab";
import { FootageViewer } from "@/components/shots/FootageViewer";
import { duplicateShot, internallyApproveShot, shareWithClient, unshareFromClient } from "@/actions/shots";
import { duplicateShot, internallyApproveShot, shareWithClient, unshareFromClient, unapproveShot } from "@/actions/shots";
const STATUS_CONFIG: Record<
string,
@@ -137,6 +137,21 @@ export default function ShotDetailPage() {
}
};
const handleUnapproveShot = async () => {
if (!shot) return;
if (!confirm("Undo client approval? The shot will return to Internally Approved.")) return;
setIsActioning(true);
try {
await unapproveShot(shot.id);
toast({ title: "Client approval undone", description: "Status: Ready for Client" });
fetchShot();
} catch (e) {
toast({ title: "Failed", description: e instanceof Error ? e.message : undefined, variant: "destructive" });
} finally {
setIsActioning(false);
}
};
const handleDuplicate = async () => {
if (!shot) return;
setIsDuplicating(true);
@@ -317,6 +332,20 @@ export default function ShotDetailPage() {
</Button>
)}
{/* Undo client approval */}
{canInternallyApprove && shot.shotApprovalStatus === "CLIENT_APPROVED" && (
<Button
variant="outline"
size="sm"
onClick={handleUnapproveShot}
disabled={isActioning}
className="gap-2 border-amber-500/40 text-amber-400 hover:bg-amber-500/10"
>
<AlertCircle className="h-3.5 w-3.5" />
Undo Client Approval
</Button>
)}
<Button
variant="outline"
size="sm"