import React from 'react'
import { Button } from '@/components/ui/button'
import {
Tooltip,
TooltipContent,
TooltipProvider,
TooltipTrigger,
} from '@/components/ui/tooltip'
interface TaskStatusButtonProps {
status: 'todo' | 'in_progress' | 'done' | 'blocked'
currentStatus: 'todo' | 'in_progress' | 'done' | 'blocked'
onClick: () => void
compact?: boolean
}
const statusConfig = {
todo: {
icon: '📋',
label: 'To Do',
actionLabel: 'Move to To Do',
tooltip: 'Click to mark this task as "To Do" - ready to be started',
description: 'Task is waiting to be started',
color: 'text-blue-400',
bgColor: 'hover:bg-blue-500/20',
borderColor: 'hover:border-blue-500/50',
activeBg: 'bg-blue-500/30 border-blue-500/60',
ring: 'ring-blue-500/50'
},
in_progress: {
icon: 'âš¡',
label: 'In Progress',
actionLabel: 'Start Working',
tooltip: 'Click to mark this task as "In Progress" - currently being worked on',
description: 'Task is currently being worked on',
color: 'text-purple-400',
bgColor: 'hover:bg-purple-500/20',
borderColor: 'hover:border-purple-500/50',
activeBg: 'bg-purple-500/30 border-purple-500/60',
ring: 'ring-purple-500/50'
},
done: {
icon: '✓',
label: 'Done',
actionLabel: 'Mark Complete',
tooltip: 'Click to mark this task as "Done" - task has been completed',
description: 'Task has been completed successfully',
color: 'text-green-400',
bgColor: 'hover:bg-green-500/20',
borderColor: 'hover:border-green-500/50',
activeBg: 'bg-green-500/30 border-green-500/60',
ring: 'ring-green-500/50'
},
blocked: {
icon: 'âš ',
label: 'Blocked',
actionLabel: 'Mark Blocked',
tooltip: 'Click to mark this task as "Blocked" - cannot proceed due to dependencies',
description: 'Task cannot proceed due to dependencies or issues',
color: 'text-red-400',
bgColor: 'hover:bg-red-500/20',
borderColor: 'hover:border-red-500/50',
activeBg: 'bg-red-500/30 border-red-500/60',
ring: 'ring-red-500/50'
}
}
export function TaskStatusButton({ status, currentStatus, onClick, compact = false }: TaskStatusButtonProps) {
const config = statusConfig[status]
const isActive = status === currentStatus
const isCurrent = status === currentStatus
const button = (
)
// Always wrap with tooltip for better UX
return (
{config.icon}
{isActive ? `Current: ${config.label}` : config.actionLabel}
{config.tooltip} ✓ Active Status