import { useDesignStore } from '../store/designStore';

interface OrderButtonProps {
  onClick?: () => void;
}

function OrderButton({ onClick }: OrderButtonProps) {
  const slots = useDesignStore((s) => s.slots);
  const allFilled = slots.length > 0 && slots.every((s) => s.stone !== null);

  return (
    <button
      type="button"
      disabled={!allFilled}
      onClick={allFilled ? onClick : undefined}
      className={`w-full py-2 rounded-lg text-sm font-semibold transition-colors ${
        allFilled
          ? 'bg-purple-500 hover:bg-purple-600 text-white cursor-pointer'
          : 'bg-white/10 text-white/40 cursor-not-allowed'
      }`}
    >
      Sipariş Oluştur
    </button>
  );
}

export default OrderButton;
