1import { Schema as S } from "effect";
2import type { Runtime, Update } from "foldkit";
3import type { Document, HtmlBuilder } from "foldkit/html";
4
5import { card } from "./components/Card.ts";
6
7// MODEL
8
9export const Model = S.Struct({});
10export type Model = typeof Model.Type;
11
12// MESSAGE
13
14// The page is static — nothing dispatches, so the app has no messages.
15export type Message = never;
16
17// UPDATE
18
19export const update = (
20 model: Model,
21 _message: Message,
22): Update.Return<Model, Message> => ({ model });
23
24// INIT
25
26export const init: Runtime.ApplicationInit<Model, Message> = () => ({
27 model: {},
28});
29
30// VIEW
31
32export const view = (_model: Model, h: HtmlBuilder<Message>): Document => ({
33 title: "Foldkit",
34 body: h.div(
35 [h.Id("app")],
36 [
37 h.h1([h.Class("text-3xl font-bold")], ["Hello from Foldkit!"]),
38 card(h, {
39 title: "Styled with Tailwind CSS",
40 body: "This card is a Foldkit view function styled with Tailwind utilities.",
41 }),
42 ],
43 ),
44});