Merge branch 'feat/inda-383-daily-stat' into 'main'
[ProtonMail-WebClient.git] / packages / components / containers / messages / SwipeActionSelect.tsx
blobb491ea842547e4ebfe2bd3b70f76637d10caef82
1 import { c } from 'ttag';
3 import Option from '@proton/components/components/option/Option';
4 import SelectTwo from '@proton/components/components/selectTwo/SelectTwo';
5 import { SWIPE_ACTION } from '@proton/shared/lib/mail/mailSettings';
7 export interface SwipeActionSelectProps {
8     onChange: (swipeAction: SWIPE_ACTION) => void;
9     value: SWIPE_ACTION;
10     id?: string;
11     loading?: boolean;
14 const SwipeActionSelect = ({ onChange, ...rest }: SwipeActionSelectProps) => {
15     const options = [
16         { title: c('Option').t`Trash`, value: SWIPE_ACTION.Trash },
17         { title: c('Option').t`Spam`, value: SWIPE_ACTION.Spam },
18         { title: c('Option').t`Star`, value: SWIPE_ACTION.Star },
19         { title: c('Option').t`Archive`, value: SWIPE_ACTION.Archive },
20         { title: c('Option').t`Mark as read`, value: SWIPE_ACTION.MarkAsRead },
21     ];
22     return (
23         <SelectTwo onChange={({ value }) => onChange(value)} {...rest}>
24             {options.map(({ title, value }) => (
25                 <Option key={value} title={title} value={value} />
26             ))}
27         </SelectTwo>
28     );
31 export default SwipeActionSelect;