"use client"; import { ScrollArea } from "@/components/ui/scroll-area"; import { AudioProperties } from "./audio-properties"; import { VideoProperties } from "./video-properties"; import { TextProperties } from "./text-properties"; import { EffectProperties } from "./effect-properties"; import { EmptyView } from "./empty-view"; import { useEditor } from "@/hooks/use-editor"; import { useElementSelection } from "@/hooks/timeline/element/use-element-selection"; import type { TimelineElement, TimelineTrack } from "@/types/timeline"; function ElementProperties({ track, element, }: { track: TimelineTrack; element: TimelineElement; }) { if (element.type === "text") { return ; } if (element.type === "audio") { return ; } if ( element.type === "video" || element.type === "image" || element.type === "sticker" ) { return ; } if (element.type === "effect") { return ; } return null; } export function PropertiesPanel() { const editor = useEditor(); const { selectedElements } = useElementSelection(); const elementsWithTracks = editor.timeline.getElementsWithTracks({ elements: selectedElements, }); const hasSelection = selectedElements.length > 0; return (
{hasSelection ? ( {elementsWithTracks.map(({ track, element }) => ( ))} ) : ( )}
); }