chore: add children prop

This commit is contained in:
ValdiANS
2025-11-12 13:23:20 +07:00
parent 73ab5703db
commit c9092f36e3
+5 -1
View File
@@ -9,7 +9,7 @@ import Button from '@/components/Button';
import { cn } from '@/lib/helper'; import { cn } from '@/lib/helper';
import { Color } from '@/types/theme'; import { Color } from '@/types/theme';
interface ConfirmationModalProps { export interface ConfirmationModalProps {
ref: RefObject<HTMLDialogElement | null>; ref: RefObject<HTMLDialogElement | null>;
type?: 'info' | 'success' | 'error'; type?: 'info' | 'success' | 'error';
text?: string; text?: string;
@@ -30,6 +30,7 @@ interface ConfirmationModalProps {
modal?: string; modal?: string;
modalBox?: string; modalBox?: string;
}; };
children?: React.ReactNode;
} }
const ConfirmationModal = ({ const ConfirmationModal = ({
@@ -40,6 +41,7 @@ const ConfirmationModal = ({
primaryButton, primaryButton,
secondaryButton, secondaryButton,
className, className,
children,
}: ConfirmationModalProps) => { }: ConfirmationModalProps) => {
const closeModalHandler = () => { const closeModalHandler = () => {
ref.current?.close(); ref.current?.close();
@@ -90,6 +92,8 @@ const ConfirmationModal = ({
{text ?? 'Apakah anda yakin ingin melakukan hal ini?'} {text ?? 'Apakah anda yakin ingin melakukan hal ini?'}
</p> </p>
{children && <div className='w-full'>{children}</div>}
<div className='w-full flex flex-row gap-2'> <div className='w-full flex flex-row gap-2'>
{secondaryButton && secondaryButton.text && ( {secondaryButton && secondaryButton.text && (
<Button <Button