/**
* SaveButton - Button with state-driven text/icon for save operations.
* Cycles through idle, saving (disabled), and saved (with CheckCircle icon).
*/
import { CheckCircle } from '@phosphor-icons/react'
import { cn } from '@/lib/utils'
import type { SaveStatus } from '@/hooks/use-save-state'
interface SaveButtonProps {
status: SaveStatus
onClick: () => void
label?: string
savingLabel?: string
savedLabel?: string
className?: string
}
export function SaveButton({
status,
onClick,
label = 'Save',
savingLabel = 'Saving...',
savedLabel = 'Saved',
className,
}: SaveButtonProps) {
return (
<>
{status === 'saved' ? `${savedLabel}.` : ''}
>
)
}