@ -2,7 +2,7 @@
import { useState , useEffect , useCallback , useMemo , useRef } from "react" ;
import { useState , useEffect , useCallback , useMemo , useRef } from "react" ;
import { WorkflowFile } from "@/store/workflowStore" ;
import { WorkflowFile } from "@/store/workflowStore" ;
import { getAllPresets , PRESET_TEMPLATES , getTemplateContent } from "@/lib/quickstart/templates" ;
import { getAllPresets , PRESET_TEMPLATES } from "@/lib/quickstart/templates" ;
import { QuickstartBackButton } from "./QuickstartBackButton" ;
import { QuickstartBackButton } from "./QuickstartBackButton" ;
import { TemplateCard } from "./TemplateCard" ;
import { TemplateCard } from "./TemplateCard" ;
import { CommunityWorkflowMeta , TemplateCategory , TemplateMetadata } from "@/types/quickstart" ;
import { CommunityWorkflowMeta , TemplateCategory , TemplateMetadata } from "@/types/quickstart" ;
@ -69,20 +69,17 @@ export function TemplateExplorerView({
return metadata ;
return metadata ;
} , [ ] ) ;
} , [ ] ) ;
// Get primary thumbnail from template content (first image)
// Primary thumbnails (resized content images - 288px for 2x retina)
const primaryThumbnails = useMemo ( ( ) = > {
const primaryThumbnails : Record < string , string > = {
const images : Record < string , string | undefined > = { } ;
"product-shot" : "/template-thumbnails/primary/product-shot.jpg" ,
PRESET_TEMPLATES . forEach ( ( template ) = > {
"model-product" : "/template-thumbnails/primary/model-product.jpg" ,
const content = getTemplateContent ( template . id , "full" ) ;
"color-variations" : "/template-thumbnails/primary/color-variations.jpg" ,
if ( content ? . images ) {
"background-swap" : "/template-thumbnails/primary/background-swap.jpg" ,
const imageUrls = Object . values ( content . images ) . map ( ( img ) = > img . url ) ;
"style-transfer" : "/template-thumbnails/primary/style-transfer.png" ,
images [ template . id ] = imageUrls [ 0 ] ;
"scene-composite" : "/template-thumbnails/primary/scene-composite.jpg" ,
}
} ;
} ) ;
return images ;
} , [ ] ) ;
// Hover thumbnails (workflow screenshots)
// Hover thumbnails (workflow screenshots - 288px)
const hoverThumbnails : Record < string , string > = {
const hoverThumbnails : Record < string , string > = {
"product-shot" : "/template-thumbnails/product-shot.png" ,
"product-shot" : "/template-thumbnails/product-shot.png" ,
"model-product" : "/template-thumbnails/model-product.png" ,
"model-product" : "/template-thumbnails/model-product.png" ,