Open source CapCut alternative.
TypeScript
"use client";
import { DonkeyMark } from "@/components/DonkeyMark";
import { useTranslations } from "next-intl";
import {
Check,
ChevronDown,
ChevronLeft,
Monitor,
Share2,
Smartphone,
Sparkles,
Upload,
} from "lucide-react";
import type { MockProject } from "@/cut/components/editor-mock/mockData";
// Static replica of src/cut/components/TopBar.tsx — same chrome, no store.
export function MockTopBar({ project }: { project: MockProject }) {
const t = useTranslations("mock");
const AspectIcon = project.aspect === "9:16" ? Smartphone : Monitor;
const aspectName = t(project.aspect === "9:16" ? "aspectNames.vertical" : "aspectNames.widescreen");
return (
<header className="relative flex items-center justify-between border-b border-border bg-card pr-3 pl-2">
<div className="absolute left-1/2 flex -translate-x-1/2 items-center gap-2">
<span className="flex items-center gap-1.5 rounded-full border border-border bg-card px-3 py-1.5 text-xs font-medium text-muted-foreground shadow-xs">
<AspectIcon className="size-3.5" />
{t("topBar.aspect", { name: aspectName, ratio: project.aspect })}
<ChevronDown className="size-3" />
</span>
<span className="flex items-center gap-1.5 rounded-full border border-border bg-card px-3 py-1.5 text-xs font-medium text-muted-foreground shadow-xs">
<span className="size-2 rounded-full bg-red-500" aria-hidden />
{t("topBar.record")}
<ChevronDown className="size-3" />
</span>
</div>
<div className="flex min-w-0 items-center gap-1">
<span className="grid size-7 place-items-center rounded-md text-muted-foreground">
<ChevronLeft className="size-4" />
</span>
<span className="grid size-[22px] shrink-0 place-items-center">
<DonkeyMark alt="" />
</span>
<span className="ml-1.5 max-w-64 truncate rounded-md px-2 py-1 text-sm font-medium tracking-tight">
{project.name}
</span>
<span className="ml-2 flex items-center gap-1 text-[11px] text-muted-foreground opacity-60">
<Check className="size-3" /> {t("topBar.saved")}
</span>
</div>
{/* Share and Export are ghost buttons; Chat is the primary control and
reads as pressed, since the chat column is open beside the cut. */}
<div className="flex items-center gap-2">
<span className="flex h-8 items-center gap-1.5 rounded-md px-3 text-xs font-medium text-foreground">
<Share2 className="size-3.5" /> {t("topBar.share")}
</span>
<span className="flex h-8 items-center gap-1.5 rounded-md px-3 text-xs font-medium text-foreground">
<Upload className="size-3.5" /> {t("topBar.export")}
</span>
<span className="flex h-8 items-center gap-1.5 rounded-md bg-primary px-3 text-xs font-medium text-primary-foreground shadow-xs">
<Sparkles className="size-3.5" /> {t("topBar.chat")}
</span>
</div>
</header>
);
}