'use client'; import { memo } from 'react'; import { IconDeviceFloppy, IconX, IconLoader2, IconRobot, IconUser, IconArrowRight, IconCopy, IconRefresh, IconTrash, IconSend, } from '@tabler/icons-react'; import { Button } from '@kandev/ui/button'; import { Tooltip, TooltipContent, TooltipTrigger } from '@kandev/ui/tooltip'; import { cn, formatRelativeTime } from '@/lib/utils'; import type { TaskPlan } from '@/lib/types/http'; type TaskPlanToolbarProps = { plan: TaskPlan | null; hasUnsavedChanges: boolean; hasDraftContent: boolean; isSaving: boolean; isAgentBusy: boolean; isReanalyzing: boolean; hasActiveSession: boolean; showApproveButton?: boolean; // Comments props commentCount?: number; isSubmittingComments?: boolean; onSubmitComments?: () => void; onClearComments?: () => void; // Existing handlers onSave: () => void; onDiscard: () => void; onCopy: () => void; onReanalyze: () => void; onClear: () => void; onApprove?: () => void; }; export const TaskPlanToolbar = memo(function TaskPlanToolbar({ plan, hasUnsavedChanges, hasDraftContent, isSaving, isAgentBusy, isReanalyzing, hasActiveSession, showApproveButton, commentCount = 0, isSubmittingComments = false, onSubmitComments, onClearComments, onSave, onDiscard, onCopy, onReanalyze, onClear, onApprove, }: TaskPlanToolbarProps) { const hasComments = commentCount > 0; return (