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