feat: module Images complet — drop, traitement IA, Shopify, upload
This commit is contained in:
@@ -1,9 +1,61 @@
|
||||
'use client'
|
||||
import { useState } from 'react'
|
||||
import { Header } from '@/components/layout/Header'
|
||||
import { DropZone } from '@/components/images/DropZone'
|
||||
import { ImageCard } from '@/components/images/ImageCard'
|
||||
import { Lightbox } from '@/components/images/Lightbox'
|
||||
import { GlobalActions } from '@/components/images/GlobalActions'
|
||||
import { useImages } from '@/hooks/useImages'
|
||||
import type { ImageItem } from '@/types/images'
|
||||
|
||||
export default function ImagesPage() {
|
||||
const { items, addFiles, setFeather, rotate, uploadOne, uploadAll, removeItem } = useImages()
|
||||
const [lightboxItem, setLightboxItem] = useState<ImageItem | null>(null)
|
||||
|
||||
return (
|
||||
<>
|
||||
<Header title="🖼️ Images" />
|
||||
<div className="p-6"><p className="text-gray-400 text-sm">Module Images — à implémenter (Plan 2)</p></div>
|
||||
<Header
|
||||
title="🖼️ Images"
|
||||
actions={
|
||||
<span className="text-xs text-slate-500">
|
||||
{items.length > 0 ? `${items.length} image${items.length > 1 ? 's' : ''}` : ''}
|
||||
</span>
|
||||
}
|
||||
/>
|
||||
|
||||
<div className="p-6 flex flex-col gap-4 flex-1 overflow-y-auto">
|
||||
<DropZone onFiles={addFiles} />
|
||||
|
||||
{items.length > 0 && (
|
||||
<GlobalActions items={items} onUploadAll={uploadAll} />
|
||||
)}
|
||||
|
||||
{items.length > 0 && (
|
||||
<div className="grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 gap-4">
|
||||
{items.map((item) => (
|
||||
<ImageCard
|
||||
key={item.id}
|
||||
item={item}
|
||||
onFeatherChange={setFeather}
|
||||
onRotate={rotate}
|
||||
onUpload={uploadOne}
|
||||
onRemove={removeItem}
|
||||
onOpenLightbox={setLightboxItem}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
|
||||
{items.length === 0 && (
|
||||
<div className="text-center py-12 text-slate-600">
|
||||
<p className="text-4xl mb-3">📂</p>
|
||||
<p className="text-sm">Déposez des images pour commencer</p>
|
||||
<p className="text-xs mt-1">Le nom du fichier (sans extension) doit correspondre à une référence produit Shopify</p>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<Lightbox item={lightboxItem} onClose={() => setLightboxItem(null)} />
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user