1 import { c } from 'ttag';
3 import Radio from '@proton/components/components/input/Radio';
5 import type { Condition } from '../filters/interfaces';
6 import { ConditionComparator } from '../filters/interfaces';
11 onUpdate: (condition: Condition) => void;
14 const AttachmentsCondition = ({ index, condition, onUpdate }: Props) => {
15 const withAttachment = condition?.comparator === ConditionComparator.CONTAINS;
16 const toggleAttachment = () => {
19 comparator: withAttachment ? ConditionComparator.DOES_NOT_CONTAIN : ConditionComparator.CONTAINS,
24 <div className="flex w-full mb-6 flex-column md:flex-row">
26 id={`condition-${index}-with-attachment`}
27 name={`attachment-condition-${index}`}
28 className="inline-flex items-center mr-4 mb-2 md:mb-0"
29 checked={withAttachment}
30 onChange={toggleAttachment}
32 {c('email_forwarding_2023: Label').t`With attachment`}
35 id={`condition-${index}-without-attachment`}
36 name={`attachment-condition-${index}`}
37 className="inline-flex items-center"
38 checked={!withAttachment}
39 onChange={toggleAttachment}
41 {c('email_forwarding_2023: Label').t`Without attachment`}
47 export default AttachmentsCondition;