@@ -5,6 +5,7 @@ import { Dialog, Form } from '@douglasneuroinformatics/libui/components';
55import { useNotificationsStore } from '@douglasneuroinformatics/libui/hooks' ;
66import type { $LoginCredentials } from '@opendatacapture/schemas/auth' ;
77import axios from 'axios' ;
8+ import { CheckIcon , XIcon } from 'lucide-react' ;
89import { err , ok } from 'neverthrow' ;
910import type { ResultAsync } from 'neverthrow' ;
1011import { z } from 'zod/v4' ;
@@ -25,6 +26,7 @@ export type LoginDialogProps = {
2526
2627export const LoginDialog = ( { isOpen, setIsOpen } : LoginDialogProps ) => {
2728 const apiBaseUrl = useAppStore ( ( store ) => store . settings . apiBaseUrl ) ;
29+ const isAuthorized = useAppStore ( ( store ) => ! ! store . auth ) ;
2830 const updateSettings = useAppStore ( ( store ) => store . updateSettings ) ;
2931
3032 const addNotification = useNotificationsStore ( ( store ) => store . addNotification ) ;
@@ -68,6 +70,23 @@ export const LoginDialog = ({ isOpen, setIsOpen }: LoginDialogProps) => {
6870 Login to your Open Data Capture instance. A special access token is used that grants permissions to create
6971 instruments only. You must have permission to create instruments to use this functionality.
7072 </ Dialog . Description >
73+ < div className = "mt-2 flex items-center gap-1 text-sm font-medium" >
74+ { isAuthorized ? (
75+ < >
76+ < div className = "flex h-4 w-4 items-center justify-center rounded-full bg-green-600" >
77+ < CheckIcon className = "text-white" style = { { height : '12px' , width : '12px' } } />
78+ </ div >
79+ < span > You are already logged in</ span >
80+ </ >
81+ ) : (
82+ < >
83+ < div className = "flex h-4 w-4 items-center justify-center rounded-full bg-red-600" >
84+ < XIcon className = "text-white" style = { { height : '12px' , width : '12px' } } />
85+ </ div >
86+ < span > You are not currently logged in</ span >
87+ </ >
88+ ) }
89+ </ div >
7190 </ Dialog . Header >
7291 < Dialog . Body className = "grid gap-4" >
7392 < Form
0 commit comments