| 1 | import { createAsync, query } from "@solidjs/router"; |
| 2 | import { Suspense } from "solid-js"; |
| 3 | import Card from "../components/Card.tsx"; |
| 4 | import Counter from "../components/Counter.tsx"; |
| 5 | |
| 6 | const getGreeting = query(async () => { |
| 7 | "use server"; |
| 8 | return process.env.GREETING ?? "Hello!"; |
| 9 | }, "neon-greeting"); |
| 10 | |
| 11 | export default function Home() { |
| 12 | const greeting = createAsync(() => getGreeting()); |
| 13 | return ( |
| 14 | <main> |
| 15 | <Suspense fallback={<p>Loading greeting...</p>}> |
| 16 | <h1 class="text-3xl font-bold">{greeting()}</h1> |
| 17 | </Suspense> |
| 18 | <Card |
| 19 | title="Styled with Tailwind CSS" |
| 20 | body="This card is a Solid component styled with Tailwind utilities." |
| 21 | /> |
| 22 | <Counter /> |
| 23 | </main> |
| 24 | ); |
| 25 | } |