import { zodResolver } from '@hookform/resolvers/zod' import { Pencil, ThumbsDown, ThumbsUp, Trash2 } from 'lucide-react' import { useEffect, useState, type PropsWithChildren } from 'react' import { useForm } from 'react-hook-form' import { Button, cn, Form, FormControl, FormField, Popover, PopoverContent, PopoverTrigger, TextArea, } from 'ui' import { FormItemLayout } from 'ui-patterns/form/FormItemLayout/FormItemLayout' import * as z from 'zod' 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-sm" 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-sm" 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!

) : (
(