"use client" import * as React from "react" import { RotateCcwIcon } from "lucide-react" import { Button } from "@/components/ui/button" import { useToast, type CreateToastInput, type ToastShortcutInput } from "@/components/notifications/toast" export type ActionToastOptions = Omit & { actionLabel?: React.ReactNode onAction?: () => void undoLabel?: React.ReactNode onUndo?: () => void } export type ActionToastButtonProps = React.ComponentProps & { toast: ActionToastOptions } function ActionToastButton({ toast, children, onClick, ...props }: ActionToastButtonProps) { const toaster = useToast() return ( ) } function ActionToastUndoButton({ onUndo, label = "Undo" }: { onUndo?: () => void; label?: React.ReactNode }) { return ( ) } function showActionToast( toaster: ReturnType, { actionLabel = "Action", onAction, undoLabel, onUndo, ...toast }: ActionToastOptions ) { const action = onUndo ? ( ) : onAction ? ( ) : undefined return toaster.addToast({ ...toast, action }) } function useActionToast() { const toaster = useToast() return React.useCallback( (toast: ActionToastOptions | ToastShortcutInput) => { if (typeof toast === "object" && toast !== null && !React.isValidElement(toast) && !Array.isArray(toast)) { return showActionToast(toaster, toast as ActionToastOptions) } return toaster.info(toast) }, [toaster] ) } export { ActionToastButton, showActionToast, useActionToast }