'use client'; import { useLocalization } from '@akinon/next/hooks'; import { Checkbox, Link } from '@theme/components'; import { Image } from '@akinon/next/components/image'; export const OrderCancellationItem = ({ item, value, onChange, selectOption, fileInput }) => { const { t } = useLocalization(); const checkboxStatus = (item.is_cancellable || item.is_refundable) && !item.active_cancellation_request; const handleClick = () => { const checkItem = (element) => element.order_item === item.id; const hasCancelItem = value.some(checkItem); if (hasCancelItem) { return onChange(value.filter((order) => order.order_item !== item.id)); } else { onChange([ ...value, { cancellation_type: item.is_refundable ? 'refund' : 'cancel', order_item: item.id, reason: '1', description: '' } ]); } }; return (