delete catalog
This commit is contained in:
@@ -22,7 +22,7 @@ const ModalConfrim: FC<Props> = (props: Props) => {
|
||||
<DefaulModal
|
||||
open={props.isOpen}
|
||||
close={props.close}
|
||||
title_header={t('confrim.subject')}
|
||||
title_header={'حذف'}
|
||||
isHeader
|
||||
>
|
||||
<div className='mt-6'>
|
||||
@@ -31,7 +31,7 @@ const ModalConfrim: FC<Props> = (props: Props) => {
|
||||
props.label ?
|
||||
props.label
|
||||
:
|
||||
t('confrim.content')
|
||||
'برای حذف این آیتم مطمئن هستید؟'
|
||||
}
|
||||
|
||||
{
|
||||
@@ -49,13 +49,14 @@ const ModalConfrim: FC<Props> = (props: Props) => {
|
||||
|
||||
<div className='flex gap-4 justify-center mt-10'>
|
||||
<Button
|
||||
className='w-full'
|
||||
onClick={() => props.onConfrim(props.isHasDescription ? description : undefined)}
|
||||
disabled={props.isloading}
|
||||
>
|
||||
بله
|
||||
</Button>
|
||||
<Button
|
||||
className='bg-transparent text-black border border-primary'
|
||||
className='bg-transparent w-full hover:bg-gray-100 text-black border border-primary'
|
||||
onClick={props.close}
|
||||
>
|
||||
لغو
|
||||
|
||||
@@ -4,17 +4,18 @@ import ModalConfrim from './ModalConfrim'
|
||||
|
||||
interface Props {
|
||||
onDelete: () => void,
|
||||
isloading?: boolean
|
||||
isloading?: boolean,
|
||||
colorIcon?: string,
|
||||
}
|
||||
|
||||
const TrashWithConfrim: FC<Props> = ({ onDelete, isloading = false }) => {
|
||||
const TrashWithConfrim: FC<Props> = ({ onDelete, colorIcon, isloading = false }) => {
|
||||
const [isConfirm, setIsConfirm] = useState(false)
|
||||
return (
|
||||
<div>
|
||||
<Trash
|
||||
onClick={() => setIsConfirm(true)}
|
||||
className='size-5'
|
||||
color='#888'
|
||||
className='size-[18px]'
|
||||
color={colorIcon ? colorIcon : '#888'}
|
||||
/>
|
||||
|
||||
<ModalConfrim
|
||||
|
||||
Reference in New Issue
Block a user