MCPcopy Create free account
hub / github.com/ZenNotes/zennotes / VaultStep

Function VaultStep

packages/app-core/src/components/OnboardingWizard.tsx:701–771  ·  view source on GitHub ↗
({
  isServerVaultSetup,
  canConnectRemote,
  openVaultPicker,
  connectRemoteWorkspace,
  workspaceSetupError,
  hasVault,
  onBack,
  onNext
}: {
  isServerVaultSetup: boolean
  canConnectRemote: boolean
  openVaultPicker: () => Promise<void>
  connectRemoteWorkspace: () => Promise<void>
  workspaceSetupError: string | null
  hasVault: boolean
  onBack: () => void
  onNext: () => void
})

Source from the content-addressed store, hash-verified

699}
700
701function VaultStep({
702 isServerVaultSetup,
703 canConnectRemote,
704 openVaultPicker,
705 connectRemoteWorkspace,
706 workspaceSetupError,
707 hasVault,
708 onBack,
709 onNext
710}: {
711 isServerVaultSetup: boolean
712 canConnectRemote: boolean
713 openVaultPicker: () => Promise<void>
714 connectRemoteWorkspace: () => Promise<void>
715 workspaceSetupError: string | null
716 hasVault: boolean
717 onBack: () => void
718 onNext: () => void
719}): JSX.Element {
720 return (
721 <div>
722 <StepHeading
723 eyebrow="Step 3"
724 title="Choose a vault"
725 subtitle={
726 isServerVaultSetup
727 ? 'Pick the folder on the server that ZenNotes should treat as your vault.'
728 : 'Pick a folder on this machine. ZenNotes stores notes as plain .md files — yours to keep, back up, and sync however you like.'
729 }
730 />
731
732 <div className="flex flex-col items-start gap-3 sm:flex-row sm:items-center">
733 <Button
734 variant="primary"
735 size="md"
736 onClick={() => void openVaultPicker()}
737 className="shadow-panel"
738 >
739 {isServerVaultSetup ? 'Connect to server vault' : 'Choose vault folder'}
740 </Button>
741 {canConnectRemote && (
742 <Button
743 variant="secondary"
744 size="md"
745 onClick={() => void connectRemoteWorkspace()}
746 className="shadow-panel"
747 >
748 Connect to ZenNotes Server
749 </Button>
750 )}
751 </div>
752
753 {hasVault && (
754 <div className="mt-4 rounded-xl border border-accent/30 bg-accent/10 px-4 py-3 text-sm text-ink-800">
755 Vault connected. Continue to finish setup.
756 </div>
757 )}
758

Callers

nothing calls this directly

Calls 1

connectRemoteWorkspaceFunction · 0.85

Tested by

no test coverage detected