import { Button } from '@imphnen-frontend-service/ui/atoms'; import { Modal } from '@imphnen-frontend-service/ui/molecules'; import { useConfirmItem, useItem } from '../_hook/use-item'; import { ControlledInputField } from '@imphnen-frontend-service/ui/organisms'; interface IModalAddItem { isOpen: boolean; onClose: () => void; handleAddItem?: () => Promise; currentStep?: number; nextStep: () => void; prevStep: () => void; resetStep: () => void; } const ModalAddItem = ({ isOpen, onClose, currentStep, nextStep, resetStep, handleAddItem, }: IModalAddItem) => { return ( { onClose(); resetStep(); }} disableEscapeKeyDown={true} > {currentStep === 1 && } {currentStep === 2 && ( )} ); }; interface IStepOneProps { nextStep: () => void; onClose: () => void; } const StepOne = ({ nextStep }: IStepOneProps) => { const { form, onSubmit } = useItem(nextStep); return ( <>

Tambah Item Gacha

Lengkapi detail di bawah ini untuk menambahkan item gacha

); }; interface IStepTwoProps { onClose: () => void; handleAddItem?: () => Promise; resetStep: () => void; } const StepTwo = ({ onClose, handleAddItem, resetStep }: IStepTwoProps) => { const { onConfirm, onCancel } = useConfirmItem( onClose, resetStep, handleAddItem, { success: 'Item ditambahkan ke gacha item', error: 'Item gagal ditambahkan ke gacha item', } ); return ( <>

Tambah Item

Apakah kamu yakin ingin
menambahkan item ini?

); }; export default ModalAddItem;