Refactor code

This commit is contained in:
2023-11-02 23:24:03 +07:00
parent cc147f071c
commit 6560c304c3
28 changed files with 163 additions and 157 deletions
@@ -1,11 +1,19 @@
import { forwardRef } from 'react';
// Components
import { IDialogProps } from '../../globals/interfaces';
// Styled
import { StyledBody, StyledDialog, StyledTitle } from './styled';
export interface IDialogProps<T> {
title?: string;
children?: JSX.Element[] | JSX.Element;
onClose?: () => void;
reload?: boolean;
setReload?: React.Dispatch<React.SetStateAction<boolean>>;
ref?: React.MutableRefObject<HTMLDialogElement | undefined>;
data?: T | null;
isAdd?: boolean;
}
const Dialog = forwardRef((props, ref) => {
const { title, children, onClose } = props as IDialogProps<unknown>;
return (