import { Children } from "react"; import { z } from "zod"; import type { GenerativeUILibrary } from "../types"; import { ALERT_TONES } from "../ir"; import { toTextContent } from "./toTextContent"; const MAX_CARDS = 10; export const alertVocabulary = { Alert: { description: "A highlighted message conveying urgency. `tone` drives the severity.", properties: z.object({ title: z.string().optional().describe("Alert title."), description: z .string() .optional() .describe("Supporting description text."), tone: z .enum(ALERT_TONES) .optional() .describe("Severity tone; defaults to `info`."), }), render: ({ title, description, tone, children }) => { const alertTitle = toTextContent(title); const alertDescription = toTextContent(description); return (
{alertDescription}
) : null} {children}