import { useState } from "react"; import { Radio, RadioField, RadioGroup } from "@catalyst/radio"; import { Description, Label } from "@catalyst/fieldset"; import { SampleSelector } from "./SampleSelector"; import ConnectionCreator from "./ConnectionCreator"; function classNames(...classes: string[]) { return classes.filter(Boolean).join(" "); } export const NewConnection = () => { // Flow in this component: // A. Enter name of connection // B. Select radio deciding if SAMPLE or CUSTOM connection // C. If SAMPLE, show SampleSelector component // D. If CUSTOM, show ConnectionCreator component const [connectionName, setConnectionName] = useState(""); const [isLoading] = useState(false); type RadioValue = "sample" | "custom" | null; const [selectedRadio, setSelectedRadio] = useState(null); const handleNameChange = (event: React.ChangeEvent) => { const { value } = event.target; setConnectionName(value); }; return (

New Connection

Add a new database connection

setSelectedRadio(event as RadioValue)} > Samples allow you to get started quickly Connect to your local databases or files
{selectedRadio === "sample" && ( )} {selectedRadio === "custom" && ( )}
); };