import { useCallback, useEffect, useState } from "react" import { RefreshCw } from "lucide-react" import { Button } from "@/components/ui/button" import { fetchHello, type HelloResponse } from "@/lib/api" export default function App() { const [data, setData] = useState(null) const [error, setError] = useState(null) const [loading, setLoading] = useState(true) const load = useCallback(async () => { setLoading(true) setError(null) try { setData(await fetchHello()) } catch (err) { setError(err instanceof Error ? err.message : "Something went wrong") } finally { setLoading(false) } }, []) useEffect(() => { void load() }, [load]) return (
Pocket Pascal

{data?.message ?? "Hello, World!"}

A minimal installable PWA. React + shadcn/ui on the front, Express + SQLite on the back.

{loading ? ( Asking the server… ) : error ? ( {error} ) : ( <> {data?.visits.toLocaleString()} times this hello has been said )}
) }