- {/* Header bar — always visible */}
-
-
-
- {/* Now-playing label */}
-
- {activeName ?? "YouTube"}
-
-
- {/* Spacer */}
-
-
- {/* Volume — wired to the iframe */}
-
-
- {/* Playlist picker toggle */}
- {!minimized && (
-
- )}
-
- {/* Minimize / Restore */}
-
-
- {/* Close */}
-
-
-
- {/* Expanded playlist picker (hidden when minimized) */}
- {expanded && !minimized && (
-
-
- {/* Default playlists */}
- {DEFAULT_PLAYLISTS.map((pl, idx) => (
-
- ))}
-
- {/* Divider */}
-
-
- {/* Custom slots */}
- {([0, 1] as const).map((slotIdx) => {
- const globalIdx = DEFAULT_PLAYLISTS.length + slotIdx;
- const slot = customSlots[slotIdx];
-
- if (editingSlot === slotIdx) {
- return (
-
setEditingSlot(null)}
- />
- );
- }
-
- if (slot) {
- return (
-
-
-
-
-
- );
- }
-
- // Empty slot
- return (
-
- );
- })}
-
-
- )}
-
- {/* YouTube embed iframe — kept in DOM when minimized so audio continues */}
- {embedUrl ? (
-
-
-
- ) : !minimized ? (
-
-
Pick a playlist to start listening
-
-
- ) : null}
-
- );
-}
diff --git a/apps/web/src/youtubePlayerStore.ts b/apps/web/src/youtubePlayerStore.ts
deleted file mode 100644
index 7be42f767..000000000
--- a/apps/web/src/youtubePlayerStore.ts
+++ /dev/null
@@ -1,202 +0,0 @@
-import { create } from "zustand";
-
-export interface YouTubePlaylist {
- name: string;
- /** YouTube video ID (for streams) or playlist ID */
- id: string;
- type: "video" | "playlist";
- isCustom?: boolean;
-}
-
-/**
- * Default playlists — curated YouTube streams & playlists for vibe coding.
- */
-export const DEFAULT_PLAYLISTS: YouTubePlaylist[] = [
- // Lofi
- { name: "Lofi Girl", id: "jfKfPfyJRdk", type: "video" },
- // Electronic / Chills
- { name: "Chillwave Radio", id: "5-anTj1QrWs", type: "video" },
-];
-
-export interface CustomSlot {
- name: string;
- url: string;
-}
-
-interface PersistedYouTubeState {
- isOpen: boolean;
- minimized: boolean;
- /** Index into the combined list (0-1 = defaults, 2-3 = custom) */
- selectedIndex: number | null;
- volume: number;
- customSlots: [CustomSlot | null, CustomSlot | null];
-}
-
-interface YouTubePlayerStore extends PersistedYouTubeState {
- toggle: () => void;
- setOpen: (open: boolean) => void;
- setMinimized: (minimized: boolean) => void;
- selectByIndex: (index: number) => void;
- setVolume: (volume: number) => void;
- setCustomSlot: (slotIndex: 0 | 1, name: string, url: string) => void;
- clearCustomSlot: (slotIndex: 0 | 1) => void;
-}
-
-const STORAGE_KEY = "okcode:youtube-player:v2";
-
-function readPersistedState(): PersistedYouTubeState {
- const defaults: PersistedYouTubeState = {
- isOpen: false,
- minimized: false,
- selectedIndex: 0,
- volume: 80,
- customSlots: [null, null],
- };
-
- if (typeof window === "undefined") return defaults;
-
- try {
- const raw = window.localStorage.getItem(STORAGE_KEY);
- if (!raw) return defaults;
-
- const parsed = JSON.parse(raw) as Partial