"use client"; import { Confirmation, ConfirmationAccepted, ConfirmationAction, ConfirmationActions, ConfirmationRejected, ConfirmationRequest, ConfirmationTitle, } from "@/components/ai-elements/confirmation"; import { Tool, ToolContent, ToolHeader, ToolInput, ToolOutput, } from "@/components/ai-elements/tool"; import type { ToolUIPart } from "ai"; import { CheckIcon, XIcon } from "lucide-react"; import { nanoid } from "nanoid"; const handleReject = () => { // In production, call addConfirmationResponse }; const handleAccept = () => { // In production, call addConfirmationResponse }; const toolCall: ToolUIPart = { errorText: undefined, input: { database: "analytics", params: ["2024-01-01"], query: "SELECT COUNT(*) FROM users WHERE created_at >= ?", }, output: `| User ID | Name | Email | Created At | |---------|------|-------|------------| | 1 | John Doe | john@example.com | 2024-01-15 | | 2 | Jane Smith | jane@example.com | 2024-01-20 | | 3 | Bob Wilson | bob@example.com | 2024-02-01 | | 4 | Alice Brown | alice@example.com | 2024-02-10 | | 5 | Charlie Davis | charlie@example.com | 2024-02-15 |`, state: "output-available" as const, toolCallId: nanoid(), type: "tool-database_query" as const, }; const Example = () => (