import React, { useMemo } from 'react'; import { Outlet, useLocation, useParams, useSearchParams, } from 'react-router-dom'; import { Avatar } from '@material-tailwind/react'; import Stepper from '../../../../components/Stepper'; import templates from '../../../../assets/templates'; import { LinkChainIcon } from 'components/shared/CustomIcon'; import { Heading } from 'components/shared/Heading'; // TODO: Set dynamic route for template and load details from DB const CreateWithTemplate = () => { const { orgSlug } = useParams(); const stepperValues = [ { step: 1, route: `/${orgSlug}/projects/create/template`, label: 'Create repository', }, { step: 2, route: `/${orgSlug}/projects/create/template/deploy`, label: 'Deploy', }, ]; const location = useLocation(); const [searchParams] = useSearchParams(); const template = templates.find( (template) => template.id === searchParams.get('templateId'), ); const activeStep = useMemo( () => stepperValues.find((data) => data.route === location.pathname)?.step ?? 0, [location.pathname], ); return (
); }; export default CreateWithTemplate;