import { useTranslation } from '../../i18n'; import ToggleSwitch from '../Settings/ToggleSwitch'; import ConfirmDialog from '../shared/ConfirmDialog'; import { SHARE_MAX_CHARS } from './assistantShare'; import type { useAssistantShare } from './useAssistantShare'; /** * The question before an answer goes to the trip chat: who will see it, the * text exactly as it will arrive, and whether the applied changes go along. * Nothing can be edited here; what goes out is what the preview shows. One * dialog for the window and the phone, which lays it out as a sheet. */ export default function AssistantShareDialog({ share }: { share: ReturnType }) { const { t } = useTranslation(); const { preview } = share; return ( void share.send()} title={t('assistant.share.title')} message={t('assistant.share.who')} confirmLabel={t('assistant.share.send')} danger={false} > {/* Spaced on its own: the phone's sheet sets the message flush against what follows. */}

{preview.text}

{preview.hasChanges && ( )} {preview.truncated && (

{t('assistant.share.truncated', { count: SHARE_MAX_CHARS })}

)}
); }