chore: use RowOptionsMenuWrapper

This commit is contained in:
ValdiANS
2025-11-01 15:36:11 +07:00
parent ad10ffbba3
commit b2540f1d43
+4 -13
View File
@@ -1,6 +1,6 @@
import { Icon } from '@iconify/react'; import { Icon } from '@iconify/react';
import Button from '../Button'; import Button from '../Button';
import { cn } from '@/lib/helper'; import RowOptionsMenuWrapper from '@/components/table/RowOptionsMenuWrapper';
interface TableRowOptionsProps { interface TableRowOptionsProps {
type?: 'dropdown' | 'collapse'; type?: 'dropdown' | 'collapse';
@@ -21,16 +21,7 @@ export const TableRowOptions = ({
showEdit = true, showEdit = true,
showDelete = true, showDelete = true,
}: TableRowOptionsProps) => ( }: TableRowOptionsProps) => (
<div <RowOptionsMenuWrapper type={type}>
tabIndex={type === 'dropdown' ? 0 : undefined}
className={cn(
{
'dropdown-content': type === 'dropdown',
'mt-2': type === 'collapse',
},
'p-2.5 mr-2 flex flex-col gap-1 bg-base-100 rounded-box z-10 border border-black/10 shadow'
)}
>
<Button <Button
href={`${basePath}/detail/?${queryParam}=${recordId}`} href={`${basePath}/detail/?${queryParam}=${recordId}`}
variant='ghost' variant='ghost'
@@ -56,7 +47,7 @@ export const TableRowOptions = ({
onClick={onDelete} onClick={onDelete}
variant='ghost' variant='ghost'
color='error' color='error'
className='text-error hover:text-inherit justify-start text-sm' className='justify-start text-sm text-error focus-visible:text-error-content hover:text-error-content'
> >
<Icon <Icon
icon='mdi:delete-outline' icon='mdi:delete-outline'
@@ -67,5 +58,5 @@ export const TableRowOptions = ({
Delete Delete
</Button> </Button>
)} )}
</div> </RowOptionsMenuWrapper>
); );