diff options
| author | Maze Winther <mazewinther@gmail.com> | 2025-07-10 21:24:47 +0200 |
|---|---|---|
| committer | Maze Winther <mazewinther@gmail.com> | 2025-07-10 21:24:47 +0200 |
| commit | 0acead5bb19e57088b1dc664b3cbbafca10d3988 (patch) | |
| tree | a4cf3bb6d60f5e51ea65052eb6b79ffd03d49280 /apps/web/src/components/editor/properties-panel/text-properties.tsx | |
| parent | 98d536a474e42ab03314bfd12837f38557cbad4e (diff) | |
| download | opencut-0acead5bb19e57088b1dc664b3cbbafca10d3988.tar.gz | |
refactor: move properties to dedicated folder
Diffstat (limited to 'apps/web/src/components/editor/properties-panel/text-properties.tsx')
| -rw-r--r-- | apps/web/src/components/editor/properties-panel/text-properties.tsx | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/apps/web/src/components/editor/properties-panel/text-properties.tsx b/apps/web/src/components/editor/properties-panel/text-properties.tsx new file mode 100644 index 00000000..c28a9ed0 --- /dev/null +++ b/apps/web/src/components/editor/properties-panel/text-properties.tsx @@ -0,0 +1,55 @@ +import { Textarea } from "@/components/ui/textarea";
+import { Label } from "@/components/ui/label";
+import {
+ Select,
+ SelectContent,
+ SelectItem,
+ SelectTrigger,
+ SelectValue,
+} from "@/components/ui/select";
+import { FONT_OPTIONS, FontFamily } from "@/constants/font-constants";
+import { TextElement } from "@/types/timeline";
+import { useTimelineStore } from "@/stores/timeline-store";
+
+export function TextProperties({
+ element,
+ trackId,
+}: {
+ element: TextElement;
+ trackId: string;
+}) {
+ const { updateTextElement } = useTimelineStore();
+
+ return (
+ <div className="space-y-6 p-5">
+ <Textarea
+ placeholder="Name"
+ defaultValue={element.content}
+ className="min-h-[4.5rem] resize-none"
+ onChange={(e) =>
+ updateTextElement(trackId, element.id, { content: e.target.value })
+ }
+ />
+ <div className="flex items-center justify-between gap-6">
+ <Label className="text-xs">Font</Label>
+ <Select
+ defaultValue={element.fontFamily}
+ onValueChange={(value: FontFamily) =>
+ updateTextElement(trackId, element.id, { fontFamily: value })
+ }
+ >
+ <SelectTrigger className="w-full text-xs">
+ <SelectValue placeholder="Select a font" />
+ </SelectTrigger>
+ <SelectContent>
+ {FONT_OPTIONS.map((font) => (
+ <SelectItem key={font.value} value={font.value}>
+ {font.label}
+ </SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
+ </div>
+ </div>
+ );
+}
|
