diff --git a/apps/web/src/components/editor/media-panel.tsx b/apps/web/src/components/editor/media-panel.tsx
index 3d83426..73ac0ad 100644
--- a/apps/web/src/components/editor/media-panel.tsx
+++ b/apps/web/src/components/editor/media-panel.tsx
@@ -4,7 +4,7 @@ import { useDragDrop } from "@/hooks/use-drag-drop";
import { processMediaFiles } from "@/lib/media-processing";
import { useMediaStore, type MediaItem } from "@/stores/media-store";
import { useTimelineStore } from "@/stores/timeline-store";
-import { Image, Music, Plus, Upload, Video } from "lucide-react";
+import { Image, Music, MusicIcon, Plus, TextIcon, Upload, Video, VideoIcon } from "lucide-react";
import { useEffect, useRef, useState } from "react";
import { toast } from "sonner";
import { AspectRatio } from "../ui/aspect-ratio";
@@ -24,6 +24,7 @@ import {
SelectTrigger,
SelectValue,
} from "../ui/select";
+import { cn } from "@/lib/utils";
// MediaPanel lets users add, view, and drag media (images, videos, audio) into the project.
// You can upload files or drag them from your computer. Dragging from here to the timeline adds them to your video project.
@@ -137,12 +138,6 @@ export function MediaPanel() {
const renderPreview = (item: MediaItem) => {
// Render a preview for each media type (image, video, audio, unknown)
- // Each preview is draggable to the timeline
- const baseDragProps = {
- draggable: true,
- onDragStart: (e: React.DragEvent) => startDrag(e, item),
- };
-
if (item.type === "image") {
return (
@@ -151,7 +146,6 @@ export function MediaPanel() {
alt={item.name}
className="max-w-full max-h-full object-contain rounded"
loading="lazy"
- {...baseDragProps}
/>
);
@@ -160,7 +154,7 @@ export function MediaPanel() {
if (item.type === "video") {
if (item.thumbnailUrl) {
return (
-
+

+
Video
{item.duration && (
@@ -196,10 +187,7 @@ export function MediaPanel() {
if (item.type === "audio") {
return (
-
+
Audio
{item.duration && (
@@ -212,10 +200,7 @@ export function MediaPanel() {
}
return (
-
+
Unknown
@@ -235,13 +220,15 @@ export function MediaPanel() {
/>
{/* Show overlay when dragging files over the panel */}
-
+
+
+
{/* Button to add/upload media */}
{/* Search and filter controls */}
@@ -289,7 +276,7 @@ export function MediaPanel() {
-
+
{/* Show message if no media, otherwise show media grid */}
{filteredMediaItems.length === 0 ? (
@@ -319,7 +306,14 @@ export function MediaPanel() {
variant="outline"
className="flex flex-col gap-1 p-2 h-auto w-full relative border-none !bg-transparent cursor-default"
>
-
+
+ startDrag(e, item)
+ }
+ >
{renderPreview(item)}
);
}
+
+type Tab = "media" | "audio" | "text";
+
+function TabBar() {
+ const [activeTab, setActiveTab] = useState("media");
+
+ const tabs = [
+ {
+ icon: VideoIcon,
+ label: "Media",
+ },
+ {
+ icon: MusicIcon,
+ label: "Audio",
+ },
+ {
+ icon: TextIcon,
+ label: "Text",
+ },
+ ];
+
+ return (
+
+ {tabs.map((tab) => (
+
setActiveTab(tab.label.toLowerCase() as Tab)}
+ key={tab.label}
+ >
+
+ {tab.label}
+
+ ))}
+
+ );
+}