import { AppState } from '@/ui_models/app_state'; import { toDirective } from './utils'; type Props = { appState: AppState; onViewNote: () => void; requireAuthenticationForProtectedNote: boolean; }; function NoProtectionsNoteWarning({ appState, onViewNote, requireAuthenticationForProtectedNote, }: Props) { const instructionText = requireAuthenticationForProtectedNote ? 'Authenticate to view this note.' : 'Add a passcode or create an account to require authentication to view this note.'; return (

This note is protected

{instructionText}

{!requireAuthenticationForProtectedNote && ( )}
); } export const NoProtectionsdNoteWarningDirective = toDirective( NoProtectionsNoteWarning, { onViewNote: '&', requireAuthenticationForProtectedNote: '=', } );