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} /> <Icon icon='heroicons:pencil' width={20} height={20} />
</Button> </Button>
<Button {data.length > 1 && (
type='button' <Button
variant='ghost' type='button'
color='none' variant='ghost'
onClick={() => { color='none'
onDeleteRef.current(item.id as number); onClick={() => {
}} onDeleteRef.current(item.id as number);
className='p-0 text-error hover:text-base-content' }}
> className='p-0 text-error hover:text-base-content'
<Icon icon='heroicons:trash' width={20} height={20} /> >
</Button> <Icon icon='heroicons:trash' width={20} height={20} />
</Button>
)}
</div> </div>
)} )}
</div> </div>