show generated code in preview

This commit is contained in:
Abi Raja 2023-11-14 14:49:05 -05:00
parent 209929d6b3
commit 444c16abe6
2 changed files with 9 additions and 5 deletions

View File

@ -16,7 +16,7 @@ function App() {
}
return (
<div className="mx-auto mt-10 max-w-2xl">
<div className="mx-auto mt-10 max-w-[1000px]">
<h1 className="text-2xl mb-4">Drag & Drop a Screenshot</h1>
{referenceImages.length > 0 && (
<img className="w-[300px]" src={referenceImages[0]} alt="Reference" />
@ -29,7 +29,7 @@ function App() {
)}
<CodePreview code={generatedCode} />
<Preview />
<Preview code={generatedCode} />
</div>
);
}

View File

@ -1,11 +1,15 @@
function Preview() {
interface Props {
code: string;
}
function Preview({ code }: Props) {
return (
<div className="w-[704px]">
<iframe
title="Iframe Example"
srcDoc={"<h1>Hello World</h1>"}
srcDoc={code}
className="border-[5px] border-black rounded-[33px] p-4 shadow-lg
transform scale-[0.55] origin-top-left w-[1280px] h-[832px]"
transform scale-[0.8] origin-top-left w-[1280px] h-[832px]"
></iframe>
</div>
);