mirror of
https://github.com/Nezumi-2711/react-training.git
synced 2026-09-22 20:01:59 +00:00
Refactor code
This commit is contained in:
@@ -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 (
|
||||
|
||||
Reference in New Issue
Block a user