import { zodResolver } from '@hookform/resolvers/zod' import { Pencil, ThumbsDown, ThumbsUp, Trash2 } from 'lucide-react' import { type PropsWithChildren, useEffect, useState } from 'react' import { useForm } from 'react-hook-form' import * as z from 'zod' import { Button, cn, Form_Shadcn_, FormControl_Shadcn_, FormField_Shadcn_, Popover_Shadcn_, PopoverContent_Shadcn_, PopoverTrigger_Shadcn_, TextArea_Shadcn_, } from 'ui' import { FormItemLayout } from 'ui-patterns/form/FormItemLayout/FormItemLayout' import { ButtonTooltip } from '../ButtonTooltip' export function MessageActions({ children, alwaysShow = false, }: PropsWithChildren<{ alwaysShow?: boolean }>) { return (
{children}
) } function MessageActionsEdit({ onClick, tooltip }: { onClick: () => void; tooltip: string }) { return ( } onClick={onClick} className="text-foreground-light hover:text-foreground p-1 rounded" aria-label={tooltip} tooltip={{ content: { side: 'bottom', text: tooltip, }, }} /> ) } MessageActions.Edit = MessageActionsEdit function MessageActionsDelete({ onClick }: { onClick: () => void }) { return ( } tooltip={{ content: { side: 'bottom', text: 'Delete message' } }} onClick={onClick} className="text-foreground-light hover:text-foreground p-1 rounded" title="Delete message" aria-label="Delete message" /> ) } MessageActions.Delete = MessageActionsDelete function MessageActionsThumbsUp({ onClick, isActive, disabled, }: { onClick: () => void isActive?: boolean disabled?: boolean }) { return ( {form.formState.isSubmitSuccessful ? (

We appreciate your feedback!

) : (
( )} />
)}
) } MessageActions.ThumbsDown = MessageActionsThumbsDown