import { InfoIcon } from "lucide-react"; 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 LNDForm() { const navigate = useNavigate(); const setupStore = useSetupStore(); const [lndAddress, setLndAddress] = React.useState( setupStore.nodeInfo.lndAddress || "" ); const [lndCertFile, setLndCertFile] = React.useState( setupStore.nodeInfo.lndCertFile || "" ); const [lndMacaroonFile, setLndMacaroonFile] = React.useState( setupStore.nodeInfo.lndMacaroonFile || "" ); // TODO: proper onboarding function onSubmit(e: React.FormEvent) { e.preventDefault(); handleSubmit({ lndAddress, lndCertFile, lndMacaroonFile, }); } async function handleSubmit(data: object) { setupStore.updateNodeInfo({ backendType: "LND", ...data, }); navigate("/setup/security"); } return (
setLndAddress(e.target.value)} value={lndAddress} id="lnd-address" />
setLndMacaroonFile(e.target.value)} value={lndMacaroonFile} type="text" id="lnd-macaroon-file" />
setLndCertFile(e.target.value)} value={lndCertFile} type="text" id="lnd-cert-file" /> {!lndCertFile && (
Skipping TLS certificate is not recommended as it may expose your connection to security risks
)}
); }