mirror of
https://github.com/VibedByKaKi/t3-code-android-nightly.git
synced 2026-10-11 21:01:16 +02:00
22 lines
689 B
TypeScript
22 lines
689 B
TypeScript
import { useLoaderData } from "react-router";
|
|
import { Card } from "../components/Card.tsx";
|
|
|
|
// Runs on the server (the deployed Railway Service, or the Vite dev server
|
|
// under `alchemy dev`), so it reads the `env` declared in alchemy.run.ts
|
|
// from `process.env`.
|
|
export function loader() {
|
|
return { greeting: process.env.GREETING ?? "Hello!" };
|
|
}
|
|
|
|
export default function Home() {
|
|
const { greeting } = useLoaderData() as { greeting: string };
|
|
return (
|
|
<main>
|
|
<h1 className="text-3xl font-bold">{greeting}</h1>
|
|
<Card
|
|
title="Styled with Tailwind CSS"
|
|
body="This card is a React component styled with Tailwind utilities."
|
|
/>
|
|
</main>
|
|
);
|
|
}
|