import { Subtitle, Text, Title } from '@/Components/Preferences/PreferencesComponents/Content' import Button from '@/Components/Button/Button' import { WebApplication } from '@/Application/Application' import { observer } from '@node_modules/mobx-react-lite' import HorizontalSeparator from '@/Components/Shared/HorizontalSeparator' import { dateToLocalizedString } from '@standardnotes/snjs' import { useCallback, useState, FunctionComponent } from 'react' import ChangeEmail from '@/Components/Preferences/Panes/Account/ChangeEmail/ChangeEmail' import { ViewControllerManager } from '@/Services/ViewControllerManager' import PasswordWizard from '@/Components/PasswordWizard/PasswordWizard' import PreferencesGroup from '../../PreferencesComponents/PreferencesGroup' import PreferencesSegment from '../../PreferencesComponents/PreferencesSegment' type Props = { application: WebApplication viewControllerManager: ViewControllerManager } const Credentials: FunctionComponent = ({ application }: Props) => { const [isChangeEmailDialogOpen, setIsChangeEmailDialogOpen] = useState(false) const [shouldShowPasswordWizard, setShouldShowPasswordWizard] = useState(false) const user = application.getUser() const passwordCreatedAtTimestamp = application.getUserPasswordCreationDate() as Date const passwordCreatedOn = dateToLocalizedString(passwordCreatedAtTimestamp) const presentPasswordWizard = useCallback(() => { setShouldShowPasswordWizard(true) }, []) const dismissPasswordWizard = useCallback(() => { setShouldShowPasswordWizard(false) }, []) return ( <> Credentials Email You're signed in as {user?.email}