diff --git a/components/form/content/image-detail-form.tsx b/components/form/content/image-detail-form.tsx index ae78ece7..b9545af0 100644 --- a/components/form/content/image-detail-form.tsx +++ b/components/form/content/image-detail-form.tsx @@ -79,9 +79,10 @@ export default function FormImageDetail() { const [categories, setCategories] = useState([]); const [selectedCategory, setSelectedCategory] = useState(); const [tags, setTags] = useState([]); - const [detail, setDetail] = useState(); + const [detail, setDetail] = useState(); const [refresh, setRefresh] = useState(false); const [selectedPublishers, setSelectedPublishers] = useState([]); + const [main, setMain] = useState([]); const [selectedTarget, setSelectedTarget] = useState(""); const [unitSelection, setUnitSelection] = useState({ @@ -175,6 +176,12 @@ export default function FormImageDetail() { const details = response.data?.data; setDetail(details); + setMain({ + type: details?.fileType.name, + url: details?.files[0]?.url, + names: details?.files[0]?.fileName, + format: details?.files[0]?.format, + }); if (details.publishedForObject) { const publisherIds = details.publishedForObject.map( @@ -245,6 +252,18 @@ export default function FormImageDetail() { }); }; + const handleMain = (type: string, url: string, names: string, format: string) => { + console.log("Test 3 :", type, url, names, format); + setMain({ + type, + url, + names, + format, + }); + return false; + }; + + return (
{detail !== undefined ? ( @@ -319,6 +338,76 @@ export default function FormImageDetail() {

)} + +
+ + {/* Preview Image */} +
+ Preview +
+ + {/* Thumbnail Container with Navigation */} +
+ {/* Scroll Left Button */} + {/* */} + + {/* Scrollable Thumbnail Container */} +
+
+ {detail?.files?.map((list: any, index: number) => ( + + ))} +
+
+ + {/* Scroll Right Button */} + {/* */} +
+