import { useState } from "react"; import { Button } from "./ui/button"; import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, } from "./ui/dialog"; import { Textarea } from "./ui/textarea"; import OutputSettingsSection from "./OutputSettingsSection"; import toast from "react-hot-toast"; import { Stack } from "../lib/stacks"; interface Props { importFromCode: (code: string, stack: Stack) => void; } function ImportCodeSection({ importFromCode }: Props) { const [code, setCode] = useState(""); const [stack, setStack] = useState(undefined); const doImport = () => { if (code === "") { toast.error("Please paste in some code"); return; } if (stack === undefined) { toast.error("Please select your stack"); return; } importFromCode(code, stack); }; return ( Paste in your HTML code Make sure that the code you're importing is valid HTML.