import{r as l,j as e}from"./react-D_B_5QVd.js";import{E as d}from"./index-BdwitBZy.js";import"./jszip-C9ownNzX.js";import"./react-dom-EAO2-NBm.js";import"./scheduler-DYLXRpC5.js";import"./@google-4tyssLU_.js";import"./marked-CesSW9Du.js";import"./idb-Dob3nYDb.js";const x=["Roboto","Open Sans","Lato","Montserrat","Oswald","Source Sans Pro","Raleway","Poppins","Nunito","Merriweather","Playfair Display","Lora","Noto Sans","Ubuntu","PT Sans","Slabo 27px"],v=()=>{const[s,i]=l.useState("Roboto"),[o,c]=l.useState("The quick brown fox jumps over the lazy dog.");l.useEffect(()=>{if(s){const t="font-preview-stylesheet";let r=document.getElementById(t);r||(r=document.createElement("link"),r.id=t,r.rel="stylesheet",document.head.appendChild(r)),r.href=`https://fonts.googleapis.com/css?family=${s.replace(/ /g,"+")}&display=swap`}},[s]);const a=`@import url('https://fonts.googleapis.com/css?family=${s.replace(/ /g,"+")}&display=swap');`,n=`font-family: '${s}', sans-serif;`;return e.jsxs("div",{className:"h-full flex flex-col p-4 sm:p-6 lg:p-8 text-text-primary",children:[e.jsxs("header",{className:"mb-6",children:[e.jsxs("h1",{className:"text-3xl font-bold flex items-center",children:[e.jsx(d,{}),e.jsx("span",{className:"ml-3",children:"Font Preview & Picker"})]}),e.jsx("p",{className:"text-text-secondary mt-1",children:"Preview Google Fonts and get the CSS import rule."})]}),e.jsxs("div",{className:"flex-grow grid grid-cols-1 lg:grid-cols-3 gap-6 min-h-0",children:[e.jsxs("div",{className:"lg:col-span-1 flex flex-col gap-4 bg-surface border border-border p-6 rounded-lg",children:[e.jsx("h3",{className:"text-xl font-bold",children:"Controls"}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"font-select",className:"block text-sm font-medium text-text-secondary",children:"Select Font"}),e.jsx("select",{id:"font-select",value:s,onChange:t=>i(t.target.value),className:"w-full mt-1 px-3 py-2 rounded-md bg-surface border border-border",children:x.map(t=>e.jsx("option",{value:t,children:t},t))})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"preview-text",className:"block text-sm font-medium text-text-secondary",children:"Preview Text"}),e.jsx("textarea",{id:"preview-text",value:o,onChange:t=>c(t.target.value),className:"w-full mt-1 p-2 rounded-md bg-surface border border-border h-24 resize-none"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"block text-sm font-medium text-text-secondary",children:"CSS Rules"}),e.jsxs("div",{className:"relative",children:[e.jsx("pre",{className:"bg-background p-2 rounded-md text-primary text-xs overflow-x-auto",children:a}),e.jsx("button",{onClick:()=>navigator.clipboard.writeText(a),className:"absolute top-1 right-1 px-2 py-0.5 bg-gray-100 hover:bg-gray-200 rounded-md text-xs",children:"Copy"})]}),e.jsxs("div",{className:"relative",children:[e.jsx("pre",{className:"bg-background p-2 rounded-md text-primary text-xs overflow-x-auto",children:n}),e.jsx("button",{onClick:()=>navigator.clipboard.writeText(n),className:"absolute top-1 right-1 px-2 py-0.5 bg-gray-100 hover:bg-gray-200 rounded-md text-xs",children:"Copy"})]})]})]}),e.jsx("div",{className:"lg:col-span-2 bg-background border border-border rounded-lg p-8 flex items-center justify-center",children:e.jsx("p",{className:"text-4xl",style:{fontFamily:`'${s}', sans-serif`},children:o})})]})]})};export{v as FontPreviewPicker}; //# sourceMappingURL=FontPreviewPicker-u7VEPcYp.js.map