import ImportCar from "https://esm.town/v/tfayyaz/reactImportCar";
import { render } from "npm:preact-render-to-string";
function Car(props) {
return <h2>Hi, I am a {props.color} component Car!</h2>;
}
function Garage() {
return (
<>
<h1>Who lives in my Garage?</h1>
<ImportCar />
<Car color="red" />
<h1>Who else?</h1>
<Car color="blue" />
</>
);
}
export const preactExample = (request: Request) =>
new Response(render(<Garage />), {
headers: {
"Content-Type": "text/html",
},
});