diff --git a/src/components/modal/ConfirmationModal.tsx b/src/components/modal/ConfirmationModal.tsx index 00b63c86..3ed33650 100644 --- a/src/components/modal/ConfirmationModal.tsx +++ b/src/components/modal/ConfirmationModal.tsx @@ -8,10 +8,13 @@ import Button, { ButtonProps } from '@/components/Button'; import { cn } from '@/lib/helper'; +export type IconPosition = 'left' | 'center' | 'right'; + export interface ConfirmationModalProps { ref: RefObject; type?: 'info' | 'success' | 'error'; text?: string; + subtitleText?: string; closeOnBackdrop?: boolean; primaryButton?: ButtonProps & { text?: string; @@ -24,17 +27,22 @@ export interface ConfirmationModalProps { modalBox?: string; }; children?: React.ReactNode; + iconSize?: number; + iconPosition?: IconPosition; } const ConfirmationModal = ({ ref, type = 'info', text, + subtitleText, closeOnBackdrop, primaryButton, secondaryButton, className, children, + iconSize = 64, + iconPosition = 'center', }: ConfirmationModalProps) => { const [isPrimaryButtonLoading, setIsPrimaryButtonLoading] = useState(false); @@ -55,47 +63,112 @@ const ConfirmationModal = ({ return (
-
- {type === 'info' && ( - - )} + {iconPosition === 'center' ? ( + <> +
+ {type === 'info' && ( + + )} - {type === 'success' && ( - - )} + {type === 'success' && ( + + )} - {type === 'error' && ( - - )} -
+ {type === 'error' && ( + + )} +
-

- {text ?? 'Apakah anda yakin ingin melakukan hal ini?'} -

+

+ {text ?? 'Apakah anda yakin ingin melakukan hal ini?'} +

+ + {subtitleText && ( +

+ {subtitleText} +

+ )} + + ) : ( +
+
+ {type === 'info' && ( + + )} + + {type === 'success' && ( + + )} + + {type === 'error' && ( + + )} +
+ +
+

+ {text ?? 'Apakah anda yakin ingin melakukan hal ini?'} +

+ + {subtitleText && ( +

{subtitleText}

+ )} +
+
+ )} {children &&
{children}
} diff --git a/src/components/pages/uniformity/UniformityTable.tsx b/src/components/pages/uniformity/UniformityTable.tsx index 05e1fdd9..5e3a2f7f 100644 --- a/src/components/pages/uniformity/UniformityTable.tsx +++ b/src/components/pages/uniformity/UniformityTable.tsx @@ -420,6 +420,8 @@ const UniformityTable = ({ refresh }: { refresh?: () => void }) => { void }) => { isLoading: isDeleteLoading, onClick: singleDeleteHandler, }} - /> + className={{ + modalBox: 'rounded-2xl', + }} + > + {' '} +
+ props.row.original.label, + }, + { + accessorKey: 'value', + header: 'Value', + cell: (props) => {props.row.original.value}, + }, + ]} + pageSize={6} + className={{ + containerClassName: 'mb-0', + paginationClassName: 'hidden', + }} + /> + + void }) => { isLoading: isBulkActionLoading, onClick: bulkDeleteHandler, }} - /> + className={{ + modalBox: 'rounded-2xl', + }} + > +
+
props.row.original.label, + }, + { + accessorKey: 'value', + header: 'Value', + cell: (props) => {props.row.original.value}, + }, + ]} + pageSize={6} + className={{ + containerClassName: 'mb-0', + paginationClassName: 'hidden', + }} + /> + +