From d7c9a2391cd0916357105cc9371675d8172b45e9 Mon Sep 17 00:00:00 2001 From: Maze Winther Date: Sun, 20 Jul 2025 16:12:38 +0200 Subject: [PATCH] fix: import --- .../components/keyboard-shortcuts-help.tsx | 63 +++-- timeline-toolbar.tsx | 219 ------------------ 2 files changed, 38 insertions(+), 244 deletions(-) delete mode 100644 timeline-toolbar.tsx diff --git a/apps/web/src/components/keyboard-shortcuts-help.tsx b/apps/web/src/components/keyboard-shortcuts-help.tsx index 91cfb01a..4c8bfff5 100644 --- a/apps/web/src/components/keyboard-shortcuts-help.tsx +++ b/apps/web/src/components/keyboard-shortcuts-help.tsx @@ -1,6 +1,5 @@ "use client"; -import { useKeyboardShortcuts } from "@/hooks/use-keyboard-shortcuts"; import { useState, useEffect } from "react"; import { Button } from "./ui/button"; import { @@ -37,11 +36,11 @@ function getKeyWithModifier(key: string) { return modifier[key] || key; } -const ShortcutItem = ({ - shortcut, - recordingKey, - onStartRecording -}: { +const ShortcutItem = ({ + shortcut, + recordingKey, + onStartRecording, +}: { shortcut: KeyboardShortcut; recordingKey: string | null; onStartRecording: (keyId: string, shortcut: KeyboardShortcut) => void; @@ -72,7 +71,7 @@ const ShortcutItem = ({ {key.split("+").map((keyPart: string, partIndex: number) => { const keyId = `${shortcut.id}-${index}-${partIndex}`; return ( - - {children} - + title={ + isRecording ? "Press any key combination..." : "Click to edit shortcut" + } + > + {children} + ); }; export const KeyboardShortcutsHelp = () => { const [open, setOpen] = useState(false); const [recordingKey, setRecordingKey] = useState(null); - const [recordingShortcut, setRecordingShortcut] = useState(null); + const [recordingShortcut, setRecordingShortcut] = + useState(null); const { updateKeybinding, @@ -159,7 +161,10 @@ export const KeyboardShortcutsHelp = () => { const keyString = getKeybindingString(e); if (keyString) { // Auto-save the new keybinding - const conflict = validateKeybinding(keyString, recordingShortcut.action); + const conflict = validateKeybinding( + keyString, + recordingShortcut.action + ); if (conflict) { toast.error( `Key "${keyString}" is already bound to "${conflict.existingAction}"` @@ -175,7 +180,7 @@ export const KeyboardShortcutsHelp = () => { // Add new keybinding updateKeybinding(keyString, recordingShortcut.action); - + setRecordingKey(null); setRecordingShortcut(null); } @@ -188,12 +193,20 @@ export const KeyboardShortcutsHelp = () => { document.addEventListener("keydown", handleKeyDown); document.addEventListener("click", handleClickOutside); - + return () => { document.removeEventListener("keydown", handleKeyDown); document.removeEventListener("click", handleClickOutside); }; - }, [recordingKey, recordingShortcut, getKeybindingString, updateKeybinding, removeKeybinding, validateKeybinding, getKeybindingsForAction]); + }, [ + recordingKey, + recordingShortcut, + getKeybindingString, + updateKeybinding, + removeKeybinding, + validateKeybinding, + getKeybindingsForAction, + ]); const handleStartRecording = (keyId: string, shortcut: KeyboardShortcut) => { setRecordingKey(keyId); @@ -230,8 +243,8 @@ export const KeyboardShortcutsHelp = () => { {shortcuts .filter((shortcut) => shortcut.category === category) .map((shortcut, index) => ( - void; - setSpeed: (speed: number) => void; - addTrack: (type: TrackType) => string; - addClipToTrack: (trackId: string, clip: any) => void; - handleSplitSelected: () => void; - handleDuplicateSelected: () => void; - handleFreezeSelected: () => void; - handleDeleteSelected: () => void; -} - -export function TimelineToolbar({ - isPlaying, - currentTime, - duration, - speed, - tracks, - toggle, - setSpeed, - addTrack, - addClipToTrack, - handleSplitSelected, - handleDuplicateSelected, - handleFreezeSelected, - handleDeleteSelected, -}: TimelineToolbarProps) { - return ( -
- - {/* Play/Pause Button */} - - - - - - {isPlaying ? "Pause (Space)" : "Play (Space)"} - - - -
- - {/* Time Display */} -
- {currentTime.toFixed(1)}s / {duration.toFixed(1)}s -
- - {/* Test Clip Button - for debugging */} - {tracks.length === 0 && ( - <> -
- - - - - Add a test clip to try playback - - - )} - -
- - - - - - Split clip (S) - - - - - - - Split and keep left (A) - - - - - - - Split and keep right (D) - - - - - - - Separate audio (E) - - - - - - - Duplicate clip (Ctrl+D) - - - - - - - Freeze frame (F) - - - - - - - Delete clip (Delete) - - -
- - {/* Speed Control */} - - - - - Playback Speed - - -
- ); -}