@@ -5,7 +5,6 @@ import { renderTemplate } from '../../lib/template-renderer'
55import { useSampleData } from './SampleDataContext'
66import { SampleDataEditor } from './SampleDataEditor'
77import { Badge } from '../ui/badge'
8- import { ScrollArea } from '../ui/scroll-area'
98import { cn } from '../../lib/utils'
109
1110interface LivePreviewProps {
@@ -25,7 +24,7 @@ export const LivePreview = ({ templateStructure }: LivePreviewProps) => {
2524 } , [ templateStructure , sampleContext ] )
2625
2726 return (
28- < div className = "flex flex-col h-full overflow-hidden" >
27+ < div className = "absolute inset-0 flex flex-col overflow-hidden" >
2928 { /* Preview Header */ }
3029 < div className = "flex-shrink-0 flex items-center justify-between px-4 py-2 border-b bg-muted/30" >
3130 < span className = "text-sm font-medium" > Live Preview</ span >
@@ -49,21 +48,19 @@ export const LivePreview = ({ templateStructure }: LivePreviewProps) => {
4948 { isEditorOpen && < SampleDataEditor /> }
5049
5150 { /* Preview Content - scrollable within container */ }
52- < div className = "flex-1 min-h-0 overflow-hidden" >
53- < ScrollArea className = "h-full" >
54- < div className = "p-6 bg-muted/30" >
55- < div className = "flex justify-center" >
56- { /* A4 Paper Simulation */ }
57- < div
58- className = "bg-white rounded shadow-xl border"
59- style = { {
60- width : '210mm' ,
61- minHeight : '297mm' ,
62- maxWidth : '100%' ,
63- boxShadow :
64- '0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06), 0 0 0 1px rgba(0, 0, 0, 0.05)'
65- } }
66- >
51+ < div className = "flex-1 min-h-0 overflow-auto bg-muted/30" >
52+ < div className = "p-6" >
53+ < div className = "flex justify-center" >
54+ { /* A4 Paper Simulation */ }
55+ < div
56+ className = "bg-white rounded shadow-xl border"
57+ style = { {
58+ width : '210mm' ,
59+ minHeight : '297mm' ,
60+ boxShadow :
61+ '0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06), 0 0 0 1px rgba(0, 0, 0, 0.05)'
62+ } }
63+ >
6764 { /* Print styles scoped to preview */ }
6865 < style >
6966 { `
@@ -192,10 +189,9 @@ export const LivePreview = ({ templateStructure }: LivePreviewProps) => {
192189 className = "preview-content"
193190 dangerouslySetInnerHTML = { { __html : previewHtml } }
194191 />
195- </ div >
196192 </ div >
197193 </ div >
198- </ ScrollArea >
194+ </ div >
199195 </ div >
200196 </ div >
201197 )
0 commit comments