Hanzo Dev commited on
Commit
3ccbed7
·
1 Parent(s): e835a44

Fix TemplateComponent error - use iframe or placeholder instead

Browse files
Files changed (1) hide show
  1. app/template/[id]/page.tsx +15 -2
app/template/[id]/page.tsx CHANGED
@@ -294,9 +294,22 @@ export default function TemplatePage() {
294
  <CardContent className="p-0">
295
  <div className={`bg-muted/10 ${isFullscreen ? 'min-h-screen' : getViewportHeight()} overflow-auto`}>
296
  <div className={`${getViewportWidth()} mx-auto bg-background border border-border rounded-lg overflow-hidden shadow-xl`}>
297
- {/* Template Preview - Render actual component */}
298
  <div className="relative h-full min-h-[600px]">
299
- <TemplateComponent />
 
 
 
 
 
 
 
 
 
 
 
 
 
300
  </div>
301
  </div>
302
  </div>
 
294
  <CardContent className="p-0">
295
  <div className={`bg-muted/10 ${isFullscreen ? 'min-h-screen' : getViewportHeight()} overflow-auto`}>
296
  <div className={`${getViewportWidth()} mx-auto bg-background border border-border rounded-lg overflow-hidden shadow-xl`}>
297
+ {/* Template Preview - Show demo iframe or placeholder */}
298
  <div className="relative h-full min-h-[600px]">
299
+ {template.demoUrl ? (
300
+ <iframe
301
+ src={template.demoUrl}
302
+ className="w-full h-full border-0"
303
+ title={`${template.name} Preview`}
304
+ />
305
+ ) : (
306
+ <div className="flex items-center justify-center h-full">
307
+ <div className="text-center">
308
+ <h3 className="text-2xl font-semibold mb-2">{template.name}</h3>
309
+ <p className="text-muted-foreground">Preview coming soon</p>
310
+ </div>
311
+ </div>
312
+ )}
313
  </div>
314
  </div>
315
  </div>