| 1234567891011121314151617181920212223242526272829303132333435363738394041 |
- /*
- * Derived from vercel/ai-elements (skills/ai-elements/scripts/confirmation-rejected.tsx).
- * Copyright 2023 Vercel, Inc. Licensed under Apache-2.0.
- * Modified by ZCode: local integration, formatting and adaptations.
- * See THIRD-PARTY-NOTICES.md in the repository root for license and provenance.
- */
- "use client";
- import {
- Confirmation,
- ConfirmationAccepted,
- ConfirmationRejected,
- ConfirmationRequest,
- ConfirmationTitle,
- } from "@/components/ai-elements/confirmation";
- import { CheckIcon, XIcon } from "lucide-react";
- import { nanoid } from "nanoid";
- const Example = () => (
- <div className="w-full max-w-2xl">
- <Confirmation approval={{ approved: false, id: nanoid() }} state="output-denied">
- <ConfirmationTitle>
- <ConfirmationRequest>
- This tool wants to delete the file{" "}
- <code className="rounded bg-muted px-1.5 py-0.5 text-sm">/tmp/example.txt</code>. Do you
- approve this action?
- </ConfirmationRequest>
- <ConfirmationAccepted>
- <CheckIcon className="size-4 text-green-600 dark:text-green-400" />
- <span>You approved this tool execution</span>
- </ConfirmationAccepted>
- <ConfirmationRejected>
- <XIcon className="size-4 text-destructive" />
- <span>You rejected this tool execution</span>
- </ConfirmationRejected>
- </ConfirmationTitle>
- </Confirmation>
- </div>
- );
- export default Example;
|