diff --git a/src/apps/path-finder/components/controller/maze-controls.tsx b/src/apps/path-finder/components/controller/maze-controls.tsx index d07f46d..e8a93cb 100644 --- a/src/apps/path-finder/components/controller/maze-controls.tsx +++ b/src/apps/path-finder/components/controller/maze-controls.tsx @@ -11,6 +11,8 @@ import { } from '@pathFinder/store/path-finder.slice'; import { mazeGenerators } from '@pathFinder/algorithms'; import { speeds } from '@pathFinder/config'; +import Modals from '../modal-icon/modals'; +import { modelContent1 } from '../modal-icon/modal-content'; interface Props { defaultSpeed: Speed; @@ -46,6 +48,7 @@ function MazeControls({ defaultSpeed }: Props) { } return (
+ = 1024px) { + .mainModal { + display: flex; + } +} diff --git a/src/apps/path-finder/components/modal-icon/modals.tsx b/src/apps/path-finder/components/modal-icon/modals.tsx new file mode 100644 index 0000000..ad7309c --- /dev/null +++ b/src/apps/path-finder/components/modal-icon/modals.tsx @@ -0,0 +1,43 @@ +import { useCallback, useRef } from 'react'; +import classes from './modals.module.scss'; +import { Info, X } from 'lucide-react'; + +interface ModalItem { + id: number; + heading: string; + content: string; +} +const Modals = ({ content }: { content: ModalItem[] }) => { + const dialogRef = useRef(null); + + const handleShowModal = useCallback(() => { + if (dialogRef.current) { + dialogRef.current.showModal(); + } + }, []); + const handleCloseModal = useCallback(() => { + if (dialogRef.current) { + dialogRef.current.close(); + } + }, []); + return ( +
+ + + {content.map((item: ModalItem) => ( +
+

{item.heading}

+

{item.content}

+
+ ))} +
+ +
+ ); +}; + +export default Modals;