From 3e89d2998588f8e35c524e523ba2ee853f0f6475 Mon Sep 17 00:00:00 2001 From: Maze Winther Date: Mon, 20 Apr 2026 11:31:17 +0200 Subject: refactor: restructure files to their domains, new preview overlay system, and dep graph --- .../src/project/components/project-info-dialog.tsx | 81 ++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 apps/web/src/project/components/project-info-dialog.tsx (limited to 'apps/web/src/project/components/project-info-dialog.tsx') diff --git a/apps/web/src/project/components/project-info-dialog.tsx b/apps/web/src/project/components/project-info-dialog.tsx new file mode 100644 index 00000000..f0ea364e --- /dev/null +++ b/apps/web/src/project/components/project-info-dialog.tsx @@ -0,0 +1,81 @@ +import { + Dialog, + DialogBody, + DialogContent, + DialogFooter, + DialogHeader, + DialogTitle, +} from "@/components/ui/dialog"; +import type { TProjectMetadata } from "@/project/types"; +import { formatDate } from "@/utils/date"; +import { formatTimecode, mediaTimeToSeconds } from "opencut-wasm"; +import { Button } from "@/components/ui/button"; + +function InfoRow({ + label, + value, +}: { + label: string; + value: string | React.ReactNode; +}) { + return ( +
+ {label} + {value} +
+ ); +} + +export function ProjectInfoDialog({ + isOpen, + onOpenChange, + project, +}: { + isOpen: boolean; + onOpenChange: (open: boolean) => void; + project: TProjectMetadata; +}) { + const durationSeconds = mediaTimeToSeconds({ time: project.duration }); + const durationFormatted = + project.duration > 0 + ? (formatTimecode({ time: project.duration, format: durationSeconds >= 3600 ? "HH:MM:SS" : "MM:SS" }) ?? "") + : "0:00"; + + return ( + + event.preventDefault()}> + + + {project.name} + + + + + + + + + {project.id.slice(0, 8)} + + } + /> + + + + + + + + ); +} -- cgit v1.3.1