'use client';
import { useState } from 'react';
import { useTranslations } from 'next-intl';
import { Button } from '@/components/ui/button';
import { SettingsSection, SettingItem, Select } from './settings-section';
import { IdentityManagerModal } from '@/components/identity/identity-manager-modal';
import { useIdentityStore } from '@/stores/identity-store';
import { useSettingsStore } from '@/stores/settings-store';
import {
SUPPORTED_SUB_ADDRESS_DELIMITERS,
isSupportedSubAddressDelimiter,
isValidSubAddressDelimiter,
} from '@/lib/sub-addressing';
const CUSTOM_DELIMITER_SENTINEL = '__custom__';
const DEFAULT_CUSTOM_DELIMITER = '~';
/**
* The Account page's "Email addresses" section: the identities you send
* from (each with its name and signature), sub-addressing and, with
* Advanced on, the delimiter the server uses for it. Was its own
* Identities tab, with the delimiter over on Composing.
*/
export function EmailAddressesSection() {
const t = useTranslations('settings.identities');
const tAccount = useTranslations('settings.account');
const tEmail = useTranslations('settings.email_behavior');
const { identities } = useIdentityStore();
const { subAddressDelimiter, updateSetting } = useSettingsStore();
const [showModal, setShowModal] = useState(false);
return (
<>
{/* Identity Count */}