import React, { FC, useState } from "react"; import Image from "next/image"; import { useRouter } from "next/router"; import { Flex, Stack, Text, useRadioGroup } from "@chakra-ui/react"; import { LaunchpadLayout } from "../../src/components/launchpad"; import { RadioCardWithAffordance } from "../../src/components/form/RadioCard"; import { route, routes } from "../../src/utils/routes"; export enum CreateTokenOption { FullyManaged = "FullyManaged", SelfManaged = "SelfManaged", } export const CreateToken: FC = () => { const router = useRouter(); //@ts-ignore const [selectedOption, setSelectedOption] = useState(null); const options: { value: string; heading: string; illustration: string; helpText: string; }[] = [ { value: CreateTokenOption.FullyManaged, heading: "Fully Managed", illustration: "/fully-managed.svg", helpText: "Create a token that you can let people buy right now. You do not need to worry about liquidity providers, supply management, or pricing.", }, { value: CreateTokenOption.SelfManaged, heading: "Self Managed", illustration: "/self-managed.svg", helpText: "You want to manage your own supply and liquidity. You do not need protocol managed liquditity.", }, ]; const { getRootProps, getRadioProps } = useRadioGroup({ name: "options", onChange: setSelectedOption, }); const group = getRootProps(); const handleOnNext = async () => { if (selectedOption === CreateTokenOption.FullyManaged) router.push(route(routes.newFullyManaged)); if (selectedOption === CreateTokenOption.SelfManaged) router.push(route(routes.newManual)); }; return ( {options.map(({ value, heading, illustration, helpText }) => { const radio = getRadioProps({ value }); return ( {`${value}-illustration`} {heading} {helpText} ); })} ); }; export default CreateToken;