diff options
Diffstat (limited to 'apps/web/src/components/editable-timecode.tsx')
| -rw-r--r-- | apps/web/src/components/editable-timecode.tsx | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/apps/web/src/components/editable-timecode.tsx b/apps/web/src/components/editable-timecode.tsx index 276cb490..8450cec2 100644 --- a/apps/web/src/components/editable-timecode.tsx +++ b/apps/web/src/components/editable-timecode.tsx @@ -3,13 +3,14 @@ import { useEffect, useRef, useState } from "react"; import { formatTimecode, parseTimecode, snappedSeekTime, type FrameRate, type TimeCodeFormat } from "opencut-wasm"; import { cn } from "@/utils/ui"; +import type { MediaTime } from "@/wasm"; interface EditableTimecodeProps { - time: number; - duration: number; + time: MediaTime; + duration: MediaTime; format?: TimeCodeFormat; fps: FrameRate; - onTimeChange?: ({ time }: { time: number }) => void; + onTimeChange?: ({ time }: { time: MediaTime }) => void; className?: string; disabled?: boolean; } @@ -53,9 +54,12 @@ export function EditableTimecode({ return; } - const clampedTime = duration - ? (snappedSeekTime({ time: parsedTime, duration, rate: fps }) ?? parsedTime) - : parsedTime; + const clampedTime = ( + duration + ? (snappedSeekTime({ time: parsedTime, duration, rate: fps }) ?? + parsedTime) + : parsedTime + ) as MediaTime; onTimeChange?.({ time: clampedTime }); setIsEditing(false); |
