From e078f3067bd20675159f4707593b4d5ec7a71add Mon Sep 17 00:00:00 2001 From: Kesku Date: Mon, 23 Jun 2025 14:00:22 +0100 Subject: [PATCH] linted and formatted --- .../web/src/components/editor/media-panel.tsx | 20 ++++++++++++------- apps/web/src/components/editor/timeline.tsx | 9 +++++++-- .../ui/image-timeline-treatment.tsx | 12 ++++++++--- 3 files changed, 29 insertions(+), 12 deletions(-) diff --git a/apps/web/src/components/editor/media-panel.tsx b/apps/web/src/components/editor/media-panel.tsx index 0d6a1f1c..4b8b324e 100644 --- a/apps/web/src/components/editor/media-panel.tsx +++ b/apps/web/src/components/editor/media-panel.tsx @@ -5,10 +5,11 @@ import { AspectRatio } from "../ui/aspect-ratio"; import { DragOverlay } from "../ui/drag-overlay"; import { useMediaStore } from "@/stores/media-store"; import { processMediaFiles } from "@/lib/media-processing"; -import { Plus, Image, Video, Music, Trash2, Upload } from "lucide-react"; +import { Plus, Image as ImageIcon, Video, Music, Trash2, Upload } from "lucide-react"; import { useDragDrop } from "@/hooks/use-drag-drop"; import { useRef, useState } from "react"; import { toast } from "sonner"; +import Image from "next/image"; // 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. @@ -88,12 +89,15 @@ export function MediaPanel() { if (item.type === "image") { return ( - {item.name} startDrag(e, item)} + width={256} + height={144} /> ); } @@ -105,11 +109,13 @@ export function MediaPanel() { className="relative w-full h-full cursor-grab active:cursor-grabbing" {...baseDragProps} > - {item.name}
); @@ -213,7 +219,7 @@ export function MediaPanel() { {mediaItems.length === 0 ? (
- +

No media in project diff --git a/apps/web/src/components/editor/timeline.tsx b/apps/web/src/components/editor/timeline.tsx index 1d2df66d..d10d3a30 100644 --- a/apps/web/src/components/editor/timeline.tsx +++ b/apps/web/src/components/editor/timeline.tsx @@ -28,6 +28,7 @@ import { usePlaybackStore } from "@/stores/playback-store"; import { processMediaFiles } from "@/lib/media-processing"; import { toast } from "sonner"; import { useState, useRef, useEffect } from "react"; +import Image from "next/image"; export function Timeline() { // Timeline shows all tracks (video, audio, effects) and their clips. @@ -1146,10 +1147,12 @@ function TimelineTrackContent({ if (mediaItem.type === "image") { return (

- {mediaItem.name}
); @@ -1159,10 +1162,12 @@ function TimelineTrackContent({ return (
- {mediaItem.name}
diff --git a/apps/web/src/components/ui/image-timeline-treatment.tsx b/apps/web/src/components/ui/image-timeline-treatment.tsx index 600dd243..8a9bc35a 100644 --- a/apps/web/src/components/ui/image-timeline-treatment.tsx +++ b/apps/web/src/components/ui/image-timeline-treatment.tsx @@ -2,6 +2,7 @@ import { useState } from "react"; import { cn } from "@/lib/utils"; +import Image from "next/image"; interface ImageTimelineTreatmentProps { src: string; @@ -51,11 +52,13 @@ export function ImageTimelineTreatment({ <> {backgroundType === "blur" && (
-
@@ -63,11 +66,13 @@ export function ImageTimelineTreatment({ {backgroundType === "mirror" && (
-
)} @@ -80,11 +85,12 @@ export function ImageTimelineTreatment({ {/* Main Image Layer */}
- {alt}