import React from "react"; import { useNavigate } from "react-router"; import Container from "src/components/Container"; import TwoColumnLayoutHeader from "src/components/TwoColumnLayoutHeader"; import { Button } from "src/components/ui/button"; import { Input } from "src/components/ui/input"; import { Label } from "src/components/ui/label"; import useSetupStore from "src/state/SetupStore"; export function CLNForm() { const navigate = useNavigate(); const setupStore = useSetupStore(); const [clnAddress, setClnAddress] = React.useState( setupStore.nodeInfo.clnAddress || "" ); const [clnLightningDir, setClnLightningDir] = React.useState( setupStore.nodeInfo.clnLightningDir || "" ); const [clnAddressHold, setClnAddressHold] = React.useState( setupStore.nodeInfo.clnAddressHold || "" ); // TODO: proper onboarding function onSubmit(e: React.FormEvent) { e.preventDefault(); handleSubmit({ clnAddress, clnLightningDir, clnAddressHold, }); } async function handleSubmit(data: object) { setupStore.updateNodeInfo({ backendType: "CLN", ...data, }); navigate("/setup/security"); } return (
setClnAddress(e.target.value)} value={clnAddress} id="cln-address" />
setClnLightningDir(e.target.value)} value={clnLightningDir} type="text" id="cln-lightning-dir" />
setClnAddressHold(e.target.value)} value={clnAddressHold} id="cln-address-hold" />
); }