Skip to content

Open source CapCut alternative.

TypeScript

refactor(site): adopt SectionTitle across Cut config sections

David Le65a8b06941d8
diff --git a/site/src/cut/components/AudioPanel.tsx b/site/src/cut/components/AudioPanel.tsx
index ce2c3907..db926498 100644
--- a/site/src/cut/components/AudioPanel.tsx
+++ b/site/src/cut/components/AudioPanel.tsx
@@ -13,6 +13,7 @@ import {
Trash2,
} from "lucide-react";
import { Button } from "@/components/ui/button";
+import { SectionTitle } from "@/cut/components/SectionTitle";
import {
DropdownMenu,
DropdownMenuContent,
@@ -91,7 +92,7 @@ export function AudioPanel({
return (
<>
<div className="flex h-12 shrink-0 items-center pl-4">
- <span className="text-sm font-semibold tracking-tight">Audio</span>
+ <span className="text-sm font-semibold tracking-tight">Generate audio</span>
</div>
<div className="flex min-h-0 flex-1 flex-col gap-5 overflow-y-auto px-3.5 pb-4">
@@ -108,14 +109,6 @@ export function AudioPanel({
);
}
-function sectionLabel(text: string) {
- return (
- <span className="text-[11px] font-semibold tracking-wider text-muted-foreground uppercase">
- {text}
- </span>
- );
-}
-
function VoiceGenerator({ projectId }: { projectId: string }) {
const voice = useSpeakerVoice();
const language = useSpeechLanguage();
@@ -175,7 +168,7 @@ function VoiceGenerator({ projectId }: { projectId: string }) {
<div className="flex flex-col gap-1.5">
<div className="flex items-center gap-1">
- {sectionLabel("Voice direction")}
+ <SectionTitle>Voice direction</SectionTitle>
<TooltipProvider>
<Tooltip>
<TooltipTrigger
@@ -237,7 +230,7 @@ function VoiceGenerator({ projectId }: { projectId: string }) {
{/* The script and its generate button stay together so the button's job —
and why it's disabled until there's a script — is obvious. */}
<div className="flex flex-col gap-2">
- {sectionLabel("Script")}
+ <SectionTitle>Script</SectionTitle>
<textarea
className="voice-script min-h-[88px] w-full resize-y rounded-lg border border-input bg-transparent px-2.5 py-2 text-[12.5px] leading-relaxed outline-none focus:border-ring"
placeholder="What should the voice say?"
@@ -457,7 +450,7 @@ function ProjectAudio({
const audio = assets.filter((a) => a.type === "audio" && a.origin === "voiceover");
return (
<div className="flex flex-col gap-1.5">
- {sectionLabel("Generated audio")}
+ <SectionTitle>Generated audio</SectionTitle>
{audio.length === 0 && !importing && (
<p className="text-[11px] leading-relaxed text-muted-foreground">
No generated audio yet — write a script above and generate one.
@@ -524,7 +517,7 @@ function LibraryAudio({
if (assets.length === 0) return null;
return (
<div className="flex flex-col gap-1.5">
- {sectionLabel("Library")}
+ <SectionTitle>Library</SectionTitle>
<div className="flex flex-col gap-1.5">
{assets.map((a) => (
<AudioRow
diff --git a/site/src/cut/components/ImageGenPanel.tsx b/site/src/cut/components/ImageGenPanel.tsx
index ba1eb856..2922a16e 100644
--- a/site/src/cut/components/ImageGenPanel.tsx
+++ b/site/src/cut/components/ImageGenPanel.tsx
@@ -4,6 +4,7 @@ import { useEffect, useMemo, useRef } from "react";
import { ChevronDown, Copy, Loader2, Maximize2, Sparkles, Trash2 } from "lucide-react";
import { Button } from "@/components/ui/button";
import { DropdownMenuItem } from "@/components/ui/dropdown-menu";
+import { SectionTitle } from "@/cut/components/SectionTitle";
import { clearAssetDrag, setAssetDragData } from "@/cut/lib/assetDrag";
import { collectRefs, mentionToken, useRefCandidates, useAssetDrop } from "@/cut/lib/assetRef";
import { signInUrl, useGenerate, useSignedIn } from "@/cut/lib/generate";
@@ -185,7 +186,7 @@ export function ImageGenPanel({ projectId }: { projectId: string }) {
{generated.length > 0 && (
<div className="flex shrink-0 flex-col gap-1.5">
- <span className="text-[11px] font-semibold text-muted-foreground">Generated</span>
+ <SectionTitle>Generated</SectionTitle>
{generated.map((a) => (
<GeneratedTile
key={a.id}
diff --git a/site/src/cut/components/Lightbox.tsx b/site/src/cut/components/Lightbox.tsx
index bf577360..4b0213be 100644
--- a/site/src/cut/components/Lightbox.tsx
+++ b/site/src/cut/components/Lightbox.tsx
@@ -3,6 +3,7 @@
import { useEffect, useState } from "react";
import { Check, Copy, Loader2, Plus, X } from "lucide-react";
import { Button } from "@/components/ui/button";
+import { SectionTitle } from "@/cut/components/SectionTitle";
import { useLightbox } from "@/cut/lib/lightbox";
import { importImage, importStockVideo } from "@/cut/lib/media";
import { useEditor } from "@/cut/lib/store";
@@ -118,9 +119,7 @@ export function Lightbox() {
{item.prompt && item.prompt !== item.name && (
<div className="flex flex-col gap-1">
<div className="flex items-center justify-between">
- <span className="text-[11px] font-semibold tracking-wider text-muted-foreground uppercase">
- Prompt
- </span>
+ <SectionTitle>Prompt</SectionTitle>
<button
title="Copy prompt"
className="inline-flex items-center gap-1 rounded-md px-1.5 py-0.5 text-[10.5px] font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground"
diff --git a/site/src/cut/components/PlatformPreview.tsx b/site/src/cut/components/PlatformPreview.tsx
index 07e6c31b..4df33f59 100644
--- a/site/src/cut/components/PlatformPreview.tsx
+++ b/site/src/cut/components/PlatformPreview.tsx
@@ -22,6 +22,7 @@ import {
X,
} from "lucide-react";
import { Button } from "@/components/ui/button";
+import { SectionTitle } from "@/cut/components/SectionTitle";
import { revealExport } from "@/cut/lib/exportClient";
import { CAPTION_LIMIT, normalizeTags } from "@/cut/lib/publish";
import { useEditor } from "@/cut/lib/store";
@@ -77,7 +78,6 @@ export function PlatformPreviewDialog({
const sound = publish.soundTitle.trim() || `original sound - ${handle}`;
const combined = [caption, tagsLine].filter(Boolean).join("\n\n");
- const field = "text-[11px] font-semibold tracking-wider text-muted-foreground uppercase";
const box =
"w-full rounded-lg border border-input bg-transparent px-2.5 py-2 text-[12.5px] outline-none focus:border-ring";
@@ -106,7 +106,7 @@ export function PlatformPreviewDialog({
</div>
<div className="flex flex-col gap-1.5">
- <span className={field}>Handle</span>
+ <SectionTitle>Handle</SectionTitle>
<div className="relative">
<span className="pointer-events-none absolute top-1/2 left-2.5 -translate-y-1/2 text-[12.5px] text-muted-foreground">
@
@@ -121,7 +121,7 @@ export function PlatformPreviewDialog({
</div>
<div className="flex flex-col gap-1.5">
- <span className={field}>Caption</span>
+ <SectionTitle>Caption</SectionTitle>
<textarea
className={cn(box, "min-h-[96px] resize-y leading-relaxed")}
placeholder="What's happening in this video?"
@@ -131,7 +131,7 @@ export function PlatformPreviewDialog({
</div>
<div className="flex flex-col gap-1.5">
- <span className={field}>Tags</span>
+ <SectionTitle>Tags</SectionTitle>
<input
className={box}
placeholder="fyp howto cut"
@@ -141,7 +141,7 @@ export function PlatformPreviewDialog({
</div>
<div className="flex flex-col gap-1.5">
- <span className={field}>Sound title</span>
+ <SectionTitle>Sound title</SectionTitle>
<input
className={box}
placeholder={`original sound - ${handle}`}
diff --git a/site/src/cut/components/SidePanel.tsx b/site/src/cut/components/SidePanel.tsx
index 94ed14f3..630ae2e9 100644
--- a/site/src/cut/components/SidePanel.tsx
+++ b/site/src/cut/components/SidePanel.tsx
@@ -13,6 +13,7 @@ import {
AlertDialogHeader,
AlertDialogTitle,
} from "@/components/ui/alert-dialog";
+import { SectionTitle } from "@/cut/components/SectionTitle";
import { apiFetch, apiUrl } from "@/cut/lib/api";
import { clearAssetDrag, setAssetDragData } from "@/cut/lib/assetDrag";
import { deleteExport, revealExport } from "@/cut/lib/exportClient";
@@ -594,7 +595,7 @@ function LibraryPanel({ projectId }: { projectId: string }) {
<PanelHead title="Library" />
{templates.length > 0 && (
<div className="shrink-0 px-3.5 pb-3">
- <div className="mb-1.5 text-[11px] font-semibold text-muted-foreground">Templates</div>
+ <SectionTitle className="mb-1.5">Templates</SectionTitle>
<div className="flex flex-col gap-1.5">
{templates.map((t) => (
<div
@@ -744,7 +745,6 @@ function PublishPanel() {
const count = combined.length;
const [copiedAll, setCopiedAll] = useState(false);
- const field = "text-[11px] font-semibold tracking-wider text-muted-foreground uppercase";
return (
<>
@@ -752,7 +752,7 @@ function PublishPanel() {
<div className="flex min-h-0 flex-col gap-4 overflow-y-auto px-3.5 pb-4">
<div className="flex flex-col gap-1.5">
<div className="flex items-center justify-between">
- <span className={field}>Caption</span>
+ <SectionTitle>Caption</SectionTitle>
<CopyChip text={publish.caption.trim()} label="caption" />
</div>
<textarea
@@ -765,7 +765,7 @@ function PublishPanel() {
<div className="flex flex-col gap-1.5">
<div className="flex items-center justify-between">
- <span className={field}>Tags</span>
+ <SectionTitle>Tags</SectionTitle>
<CopyChip text={tagsLine} label="tags" />
</div>
<input
@@ -790,7 +790,7 @@ function PublishPanel() {
<div className="flex flex-col gap-1.5">
<div className="flex items-center justify-between">
- <span className={field}>Sound title</span>
+ <SectionTitle>Sound title</SectionTitle>
<CopyChip text={publish.soundTitle.trim()} label="sound title" />
</div>
<input
@@ -806,7 +806,7 @@ function PublishPanel() {
</div>
<div className="flex flex-col gap-1.5 border-t border-border pt-4">
- <span className={field}>Notes</span>
+ <SectionTitle>Notes</SectionTitle>
<label className="flex items-center justify-between gap-2 text-[12px] text-muted-foreground">
Published
<input