Update component and optimized code

This commit is contained in:
2023-11-01 09:49:30 +07:00
parent 4b7b39cc8f
commit 117723df8c
10 changed files with 124 additions and 29 deletions
@@ -7,7 +7,7 @@ import { IDialogProps } from '../../globals/interfaces';
import { StyledBody, StyledDialog, StyledTitle } from './styled';
const Dialog = forwardRef((props, ref) => {
const { title, children, onClose } = props as IDialogProps;
const { title, children, onClose } = props as IDialogProps<unknown>;
return (
<StyledDialog
ref={ref as React.LegacyRef<HTMLDialogElement> | undefined}
@@ -17,6 +17,6 @@ const Dialog = forwardRef((props, ref) => {
<StyledBody>{children}</StyledBody>
</StyledDialog>
);
}) as React.FC<IDialogProps>;
}) as React.FC<IDialogProps<unknown>>;
export default Dialog;