empty data

This commit is contained in:
hamid zarghami
2025-12-24 14:03:29 +03:30
parent 299839fd96
commit 41800bbee8
7 changed files with 177 additions and 139 deletions
@@ -60,51 +60,47 @@ const CartSummary = () => {
return (
<>
<div className='mt-2'>
<div className='relative'>
<h3 className='text-sm'>{t('InputDescription.Label')}</h3>
<textarea
className='w-full px-4 py-2.5 mt-4 text-sm2 leading-6 outline-0 border border-border rounded-normal resize-none focus:ring-0'
placeholder={t('InputDescription.Placeholder')}
id='description'
name='description'
value={description}
onChange={(e) => setDescription(e.target.value)}
></textarea>
<span className='absolute top-4 right-2 px-2 bg-background text-foreground text-xs'></span>
</div>
</div>
<div
className={`fixed bottom-0 left-0 right-0 z-50 bg-white border-t border-border p-4 w-full ${isCartEmpty ? 'pointer-events-none opacity-60' : ''}`}
>
<div className='flex justify-between items-center gap-4'>
<div className='flex flex-col'>
<div className='text-xs text-gray-400'>{t('PayableAmountLabel')}</div>
<div className='text-sm mt-2 font-semibold'>{formatPrice(totalPrice)} تومان</div>
{!isCartEmpty && (
<>
<div className='mt-2'>
<div className='relative'>
<h3 className='text-sm'>{t('InputDescription.Label')}</h3>
<textarea
className='w-full px-4 py-2.5 mt-4 text-sm2 leading-6 outline-0 border border-border rounded-normal resize-none focus:ring-0'
placeholder={t('InputDescription.Placeholder')}
id='description'
name='description'
value={description}
onChange={(e) => setDescription(e.target.value)}
></textarea>
<span className='absolute top-4 right-2 px-2 bg-background text-foreground text-xs'></span>
</div>
</div>
<Link
href={'order/checkout/0'}
onClick={(event) => {
if (isCartEmpty) {
event.preventDefault();
return;
}
if (!isSuccess) {
event.preventDefault();
const redirectUrl = encodeURIComponent(pathname);
router.push(`/${name}/auth?redirect=${redirectUrl}`);
return;
}
}}
>
<Button className='w-fit! px-10' disabled={isCartEmpty}>{t('ButtonCheckout')}</Button>
</Link>
<div className='fixed bottom-0 left-0 right-0 z-50 bg-white border-t border-border p-4 w-full'>
<div className='flex justify-between items-center gap-4'>
<div className='flex flex-col'>
<div className='text-xs text-gray-400'>{t('PayableAmountLabel')}</div>
<div className='text-sm mt-2 font-semibold'>{formatPrice(totalPrice)} تومان</div>
</div>
</div>
</div>
<Link
href={'order/checkout/0'}
onClick={(event) => {
if (!isSuccess) {
event.preventDefault();
const redirectUrl = encodeURIComponent(pathname);
router.push(`/${name}/auth?redirect=${redirectUrl}`);
return;
}
}}
>
<Button className='w-fit! px-10'>{t('ButtonCheckout')}</Button>
</Link>
</div>
</div>
</>
)}
{/* {!isCartEmpty && (
<div className='flex items-center justify-between rounded-xl border border-border px-4 py-3 text-xs text-muted-foreground'>