@hirael/unsaved-guardloading the log…
NO RECENT BUILD
Pipeline
  1. Docsusage, props, keywords
  2. Demosrc/demo.tsx
  3. Buildshadcn add → vite
  4. Capturelight, dark, motion
  5. IndexBM25 + vectors

Public log. Prompts, raw model errors and costs stay on the admin side.

Log
Demo source
src/demo.tsx · from an earlier run
import * as React from "react"import { UnsavedGuardProvider, useUnsavedGuard } from "@/components/unsaved-guard"import { Button } from "@/components/ui/button"import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "@/components/ui/card"import { Input } from "@/components/ui/input"import { Label } from "@/components/ui/label"function ProfileForm() {  const [name, setName] = React.useState("Olivia Martin")  const [saved, setSaved] = React.useState("Olivia Martin")  const dirty = name !== saved  const guard = useUnsavedGuard({ when: dirty })  return (    <Card className="w-full max-w-sm">      <CardHeader>        <CardTitle>Profile</CardTitle>        <CardDescription>Make changes to your profile here.</CardDescription>      </CardHeader>      <CardContent className="grid gap-2">        <Label htmlFor="name">Name</Label>        <Input id="name" value={name} onChange={(e) => setName(e.target.value)} />      </CardContent>      <CardFooter className="flex justify-between gap-2">        <Button variant="outline" onClick={() => guard(() => setName(saved))}>          Cancel        </Button>        <Button disabled={!dirty} onClick={() => setSaved(name)}>          Save changes        </Button>      </CardFooter>    </Card>  )}export default function UnsavedGuardDemo() {  return (    <UnsavedGuardProvider>      <ProfileForm />    </UnsavedGuardProvider>  )}