import { getGetServerSideProps } from '@/api/ssrApollo' import { Form, ClientInput, ClientCheckbox } from '@/components/form' import { CenterLayout } from '@/components/layout' import { WalletButtonBar, WalletCard } from '@/components/wallet-card' import { lnbitsSchema } from '@/lib/validate' import { useToast } from '@/components/toast' import { useRouter } from 'next/router' import { useLNbits } from '@/components/webln/lnbits' import { WalletSecurityBanner } from '@/components/banners' import { useWebLNConfigurator } from '@/components/webln' import WalletLogs from '@/components/wallet-logs' export const getServerSideProps = getGetServerSideProps({ authRequired: true }) export default function LNbits () { const { provider, enabledProviders, setProvider } = useWebLNConfigurator() const lnbits = useLNbits() const { name, url, adminKey, saveConfig, clearConfig, enabled } = lnbits const isDefault = provider?.name === name const toaster = useToast() const router = useRouter() return (

LNbits

use LNbits for payments
{ try { await saveConfig(values) if (isDefault) setProvider(lnbits) toaster.success('saved settings') router.push('/settings/wallets') } catch (err) { console.error(err) toaster.danger('failed to attach: ' + err.message || err.toString?.()) } }} > { try { await clearConfig() toaster.success('saved settings') router.push('/settings/wallets') } catch (err) { console.error(err) toaster.danger('failed to unattach: ' + err.message || err.toString?.()) } }} />
) } export function LNbitsCard () { const { enabled } = useLNbits() return ( ) }