@@ -105,10 +205,40 @@ export function Sidebar({ source, onSelect }: Props) {
-
- Playlists
+
+
+ Playlists
+
+
+
+ {creating && (
+
setNewName(e.target.value)}
+ onKeyDown={(e) => {
+ if (e.key === 'Enter') submitNew()
+ else if (e.key === 'Escape') {
+ setCreating(false)
+ setNewName('')
+ }
+ }}
+ onBlur={submitNew}
+ className="mb-1 w-full rounded-md border border-accent bg-ink-950 px-2 py-1.5 text-sm text-text outline-none"
+ />
+ )}
{isLoading &&
Loading…
}
{playlists?.map((n) => (
))}
+
+
)
}
diff --git a/frontend/src/components/StatusBar.tsx b/frontend/src/components/StatusBar.tsx
index ba60599..61ca7af 100644
--- a/frontend/src/components/StatusBar.tsx
+++ b/frontend/src/components/StatusBar.tsx
@@ -23,7 +23,7 @@ export function StatusBar({ showing, total, sourceName, loading }: Props) {
)}
)}
-
konduktor · phase 2
+
konduktor · phase 3
)
}
diff --git a/frontend/src/components/Toast.tsx b/frontend/src/components/Toast.tsx
new file mode 100644
index 0000000..7aac3d3
--- /dev/null
+++ b/frontend/src/components/Toast.tsx
@@ -0,0 +1,30 @@
+import { useEffect } from 'react'
+
+export interface ToastMsg {
+ id: number
+ kind: 'success' | 'error'
+ text: string
+}
+
+export function Toast({ toast, onClose }: { toast: ToastMsg | null; onClose: () => void }) {
+ useEffect(() => {
+ if (!toast) return
+ const t = setTimeout(onClose, toast.kind === 'error' ? 6000 : 4000)
+ return () => clearTimeout(t)
+ }, [toast, onClose])
+
+ if (!toast) return null
+ return (
+