import { getGetServerSideProps } from '@/api/ssrApollo'
import { WalletSecurityBanner } from '@/components/banners'
import { ClientCheckbox, Form, PasswordInput } from '@/components/form'
import Info from '@/components/info'
import { CenterLayout } from '@/components/layout'
import Text from '@/components/text'
import { useToast } from '@/components/toast'
import { WalletButtonBar, WalletCard, isConfigured } from '@/components/wallet-card'
import WalletLogs from '@/components/wallet-logs'
import { Status, useWebLNConfigurator } from '@/components/webln'
import { XXX_DEFAULT_PASSWORD, useLNC } from '@/components/webln/lnc'
import { lncSchema } from '@/lib/validate'
import { useRouter } from 'next/router'
import { useEffect, useRef } from 'react'
import { Wallet } from '@/lib/constants'
export const getServerSideProps = getGetServerSideProps({ authRequired: true })
export default function LNC () {
const { provider, enabledProviders, setProvider } = useWebLNConfigurator()
const toaster = useToast()
const router = useRouter()
const lnc = useLNC()
const { status, clearConfig, saveConfig, config, name, unlock } = lnc
const isDefault = provider?.name === name
const unlocking = useRef(false)
const configured = isConfigured(status)
useEffect(() => {
if (!unlocking.current && status === Status.Locked) {
unlocking.current = true
unlock()
}
}, [status, unlock])
const defaultPassword = config?.password === XXX_DEFAULT_PASSWORD
return (
Lightning Node Connect for LND
use Lightning Node Connect for LND payments
)
}
export function LNCCard () {
const { status } = useLNC()
return (
)
}