import "./components/ui/tidal.css"; import { useState } from "react"; import { TidalPromptLibrary, type TidalPromptRecord } from "./components/ui/prompt-library"; import "./components/ui/prompt-library.css"; import "./components/ui/search-field.css"; import "./components/ui/textarea.css"; import "./components/ui/native-select.css"; export const promptCategories = [ { id: "research", label: "Research" }, { id: "product", label: "Product" }, { id: "writing", label: "Writing" }, ]; export const promptRecords: readonly TidalPromptRecord[] = [ { id: "interview", title: "Customer interview summary", description: "Turn interview notes into evidence and next steps.", categoryId: "research", content: "Summarize these customer notes into pains, requests and next steps. Separate observed evidence from suggestions.\n\n{{notes}}", variables: [ { id: "notes", label: "Interview notes", placeholder: "Paste the notes to summarize", required: true, }, ], }, { id: "release", title: "Release note", description: "Explain a product change in plain language.", categoryId: "writing", content: "Write a concise release note for this change. Explain what changed, who it helps, and how to use it. Avoid unsupported claims.\n\n{{change}}", variables: [{ id: "change", label: "Product change", required: true }], }, { id: "empty", title: "Empty-state copy", description: "Write a clear next step for a new workspace.", categoryId: "product", content: "Write a short heading, one sentence, and a button label for an empty {{screen}} screen. Help the user take the first useful action.", variables: [{ id: "screen", label: "Screen name", required: true }], }, ]; export function PromptLibraryDemo() { const [query, setQuery] = useState(""), [category, setCategory] = useState(""), [favorites, setFavorites] = useState(["interview"]), [saved, setSaved] = useState(false), [selected, setSelected] = useState("interview"), [values, setValues] = useState>>({ notes: "The team needs a faster way to review open requests.", }), [status, setStatus] = useState(""); return (
setFavorites((v) => (on ? [...v, id] : v.filter((x) => x !== id))) } favoritesOnly={saved} onFavoritesOnlyChange={setSaved} selectedId={selected} onSelectedChange={setSelected} values={values} onVariableChange={(id, value) => setValues((v) => ({ ...v, [id]: value })) } onUse={(p) => setStatus(p.title + " selected in this preview. No model was called.") } /> {status && (

{status}

)}
); } export default function AgentExample() { return (
); }