diff --git a/src/components/video-editor/timeline/Item.tsx b/src/components/video-editor/timeline/Item.tsx
index 4af2d8d4..6d8abf12 100644
--- a/src/components/video-editor/timeline/Item.tsx
+++ b/src/components/video-editor/timeline/Item.tsx
@@ -20,6 +20,7 @@ interface ItemProps {
children: React.ReactNode;
isSelected?: boolean;
onSelect?: () => void;
+ onSelectId?: (id: string) => void;
zoomDepth?: number;
zoomMode?: "auto" | "manual";
speedValue?: number;
@@ -52,6 +53,7 @@ export default function Item({
rowId,
isSelected = false,
onSelect,
+ onSelectId,
zoomDepth = 1,
zoomMode = "auto",
speedValue,
@@ -88,6 +90,10 @@ export default function Item({
);
const MIN_ITEM_PX = 6;
+ const handleSelect = () => {
+ onSelect?.();
+ onSelectId?.(id);
+ };
const safeItemStyle = {
...itemStyle,
minWidth: MIN_ITEM_PX,
@@ -101,7 +107,7 @@ export default function Item({
style={safeItemStyle}
{...listeners}
{...attributes}
- onPointerDownCapture={() => onSelect?.()}
+ onPointerDownCapture={handleSelect}
className="group h-full"
>
{
event.stopPropagation();
- onSelect?.();
+ handleSelect();
}}
>
-
+
{audioPeaks && }
{clipItems.map((item) => (
@@ -104,7 +108,7 @@ export function TimelineCanvasRows({
rowId={item.rowId}
span={item.span}
isSelected={selectAllBlocksActive || item.id === selectedClipId}
- onSelect={() => onSelectClip?.(item.id)}
+ onSelectId={onSelectClip}
variant="clip"
>
{item.label}
@@ -152,7 +156,7 @@ export function TimelineCanvasRows({
rowId={item.rowId}
span={item.span}
isSelected={selectAllBlocksActive || item.id === selectedZoomId}
- onSelect={() => onSelectZoom?.(item.id)}
+ onSelectId={onSelectZoom}
zoomDepth={item.zoomDepth}
zoomMode={item.zoomMode}
variant="zoom"
@@ -171,7 +175,7 @@ export function TimelineCanvasRows({
key={rowId}
id={rowId}
isEmpty={rowItems.length === 0}
- hint={index === 0 ? "Press A to add annotation" : undefined}
+ hint={index === 0 ? HINT_ANNOTATION : undefined}
>
{rowItems.map((item) => (
- onSelectAnnotation?.(item.id)}
+ onSelectId={onSelectAnnotation}
variant="annotation"
>
{item.label}
@@ -199,7 +203,7 @@ export function TimelineCanvasRows({
key={rowId}
id={rowId}
isEmpty={rowItems.length === 0}
- hint={index === 0 ? "Click music icon to add audio" : undefined}
+ hint={index === 0 ? HINT_AUDIO : undefined}
>
{rowItems.map((item) => (
- onSelectAudio?.(item.id)}
+ onSelectId={onSelectAudio}
variant="audio"
>
{item.label}