refactor(FE): Hide delete button if only one item remains in table

This commit is contained in:
rstubryan
2026-02-13 10:37:12 +07:00
parent e9da5210ad
commit ec3a0367dd
@@ -49,17 +49,19 @@ const SalesOrderProductTable = ({
>
<Icon icon='heroicons:pencil' width={20} height={20} />
</Button>
<Button
type='button'
variant='ghost'
color='none'
onClick={() => {
onDeleteRef.current(item.id as number);
}}
className='p-0 text-error hover:text-base-content'
>
<Icon icon='heroicons:trash' width={20} height={20} />
</Button>
{data.length > 1 && (
<Button
type='button'
variant='ghost'
color='none'
onClick={() => {
onDeleteRef.current(item.id as number);
}}
className='p-0 text-error hover:text-base-content'
>
<Icon icon='heroicons:trash' width={20} height={20} />
</Button>
)}
</div>
)}
</div>