22
33import type React from "react"
44import { useState , useRef } from "react"
5- import { X , Image , Smile , Loader2 } from "lucide-react"
5+ import { X , Image as ImageIcon , Smile , Loader2 } from "lucide-react"
66import { motion , AnimatePresence } from "framer-motion"
77import NextImage from "next/image"
88import { toast } from "sonner"
@@ -32,7 +32,6 @@ const trendingTags = [
3232export function CreatePostModal ( {
3333 isOpen,
3434 onClose,
35- session,
3635 groupId,
3736 prefillContent = "" ,
3837 prefillImages = [ ] ,
@@ -262,10 +261,13 @@ export function CreatePostModal({
262261 < div className = "flex flex-wrap gap-2 mt-3" >
263262 { files . map ( ( file , i ) => (
264263 < div key = { i } className = "relative group" >
265- < img
264+ < NextImage
266265 src = { URL . createObjectURL ( file ) }
267- alt = ""
266+ alt = "preview"
267+ width = { 80 }
268+ height = { 80 }
268269 className = "h-20 w-20 object-cover rounded-lg border border-zinc-700"
270+ unoptimized
269271 />
270272 < button
271273 onClick = { ( ) => removeFile ( i ) }
@@ -282,10 +284,12 @@ export function CreatePostModal({
282284 { existingImages . length > 0 && (
283285 < div className = "flex flex-wrap gap-2 mt-3" >
284286 { existingImages . map ( ( url , i ) => (
285- < img
287+ < NextImage
286288 key = { i }
287289 src = { url }
288- alt = ""
290+ alt = "existing preview"
291+ width = { 80 }
292+ height = { 80 }
289293 className = "h-20 w-20 object-cover rounded-lg border border-zinc-700"
290294 />
291295 ) ) }
@@ -301,7 +305,7 @@ export function CreatePostModal({
301305 className = "hover:text-white transition-colors"
302306 title = "Attach image"
303307 >
304- < Image size = { 18 } />
308+ < ImageIcon size = { 18 } />
305309 </ button >
306310 < button className = "hover:text-white transition-colors" title = "Emoji" >
307311 < Smile size = { 18 } />
0 commit comments