import { motion } from "framer-motion"; import { useTree } from "../../hooks"; import { treeTemplates } from "../../constants"; import { useAppSelector } from "../../store/hook"; import { theme_state } from "../../store/features/themeSlice"; import { compiler_state } from "../../store/features/compilerSlice"; import { TemplateSelectionSkeleton } from "../Skeleton/TemplateSelectionSkeleton"; import { modalVariant } from "./config"; const TemplateModal = () => { const { theme } = useAppSelector(theme_state); const { esbuildStatus } = useAppSelector(compiler_state); const { setTree } = useTree(); let arr = []; for (const item of Object.entries(treeTemplates)) { arr.push(item); } const templates = arr.map((template, key) => ( setTree(template[1])} className="p-2 rounded-sm" > {template[1].name} {template[1].description} )); return ( e.stopPropagation()} > Templates {esbuildStatus.isReady ? templates : } ); }; export default TemplateModal;