0070fb3aea
- Mail page: 3-pane layout (folder tree + mail list + reading pane) - Compose modal: rich text editor (bold/italic/link), template picker, reply/forward pre-fill - Mail settings: accounts, signatures, rules, labels, vacation, PGP (6 tabs) - Shared mailbox selector: switch between personal + shared accounts - Mail search bar + attachment download + create-event-from-mail - Global search: tabs for companies/contacts/mails/files/events - Search autocomplete in TopBar (existing SearchDropdown) - API client: mail.ts (all endpoints) - Routes: /mail, /mail/settings - i18n: de.json + en.json mail + search translations - 44 new tests (4 test files), full regression 318/318 pass - tsc --noEmit: 0 errors, vite build: 267 modules
35 lines
969 B
TypeScript
35 lines
969 B
TypeScript
/**
|
|
* Shared mailbox selector — switch between personal and shared accounts.
|
|
*/
|
|
|
|
import React from 'react';
|
|
import { useTranslation } from 'react-i18next';
|
|
import { Select } from '@/components/ui/Select';
|
|
import type { MailAccount } from '@/api/mail';
|
|
|
|
export interface SharedMailboxSelectorProps {
|
|
accounts: MailAccount[];
|
|
selectedAccountId: string;
|
|
onSelect: (accountId: string) => void;
|
|
}
|
|
|
|
export function SharedMailboxSelector({ accounts, selectedAccountId, onSelect }: SharedMailboxSelectorProps) {
|
|
const { t } = useTranslation();
|
|
|
|
const options = accounts.map((acc) => ({
|
|
value: acc.id,
|
|
label: `${acc.display_name} (${acc.email})${acc.is_shared ? ' — ' + t('mail.shared') : ''}`,
|
|
}));
|
|
|
|
return (
|
|
<div data-testid="shared-mailbox-selector">
|
|
<Select
|
|
label={t('mail.selectAccount')}
|
|
value={selectedAccountId}
|
|
onChange={(e) => onSelect(e.target.value)}
|
|
options={options}
|
|
/>
|
|
</div>
|
|
);
|
|
}
|