'use client' import { useState } from 'react' import { toggleItem } from '@/lib/actions' import { CheckCircle2, Circle } from 'lucide-react' interface ToggleItemButtonProps { itemId: string completed: boolean } export default function ToggleItemButton({ itemId, completed }: ToggleItemButtonProps) { const [isToggling, setIsToggling] = useState(false) const handleToggle = async () => { setIsToggling(true) try { await toggleItem(itemId) } catch (error) { console.error('Error toggling item:', error) } finally { setIsToggling(false) } } return ( ) }