|
|
|
|
@ -1,14 +1,15 @@
|
|
|
|
|
import React, { type FC } from 'react'
|
|
|
|
|
import { RiCheckboxCircleLine, RiCloseCircleLine, RiDeleteBinLine } from '@remixicon/react'
|
|
|
|
|
import { RiArchive2Line, RiCheckboxCircleLine, RiCloseCircleLine, RiDeleteBinLine } from '@remixicon/react'
|
|
|
|
|
import Divider from '@/app/components/base/divider'
|
|
|
|
|
import classNames from '@/utils/classnames'
|
|
|
|
|
|
|
|
|
|
type IBatchActionProps = {
|
|
|
|
|
className?: string
|
|
|
|
|
selectedIds: string[]
|
|
|
|
|
onBatchEnable: () => Promise<void>
|
|
|
|
|
onBatchDisable: () => Promise<void>
|
|
|
|
|
onBatchDelete: () => Promise<void>
|
|
|
|
|
onBatchEnable: () => void
|
|
|
|
|
onBatchDisable: () => void
|
|
|
|
|
onBatchDelete: () => void
|
|
|
|
|
onArchive?: () => void
|
|
|
|
|
onCancel: () => void
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -17,6 +18,7 @@ const BatchAction: FC<IBatchActionProps> = ({
|
|
|
|
|
selectedIds,
|
|
|
|
|
onBatchEnable,
|
|
|
|
|
onBatchDisable,
|
|
|
|
|
onArchive,
|
|
|
|
|
onBatchDelete,
|
|
|
|
|
onCancel,
|
|
|
|
|
}) => {
|
|
|
|
|
@ -42,15 +44,24 @@ const BatchAction: FC<IBatchActionProps> = ({
|
|
|
|
|
Disable
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
{onArchive && (
|
|
|
|
|
<div className='flex items-center gap-x-0.5 px-3 py-2'>
|
|
|
|
|
<RiArchive2Line className='w-4 h-4 text-components-button-ghost-text' />
|
|
|
|
|
<button className='px-0.5 text-components-button-ghost-text text-[13px] font-medium leading-[16px]' onClick={onBatchDisable}>
|
|
|
|
|
Archive
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
<div className='flex items-center gap-x-0.5 px-3 py-2'>
|
|
|
|
|
<RiDeleteBinLine className='w-4 h-4 text-components-button-destructive-ghost-text' />
|
|
|
|
|
<button className='px-0.5 text-components-button-destructive-ghost-text text-[13px] font-medium leading-[16px]' onClick={onBatchDelete}>
|
|
|
|
|
Delete
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<Divider type='vertical' className='mx-0.5 h-3.5 bg-divider-regular' />
|
|
|
|
|
<button className='px-3.5 py-2 text-components-button-ghost-text text-[13px] font-medium leading-[16px]' onClick={onCancel}>
|
|
|
|
|
Cancel
|
|
|
|
|
Cancel
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|