Skip to content

Commit f9ff2b4

Browse files
feat: Added the LockIcon for the AutomaticImports if this feature not available in the current plan (#1142)
2 parents ec0afb5 + 7563d9b commit f9ff2b4

File tree

1 file changed

+19
-4
lines changed

1 file changed

+19
-4
lines changed

apps/web/components/imports/forms/UpdateImportForm.tsx

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
import { useEffect } from 'react';
2-
import { Stack, TextInput as Input, Text, SegmentedControl, Box } from '@mantine/core';
2+
import { Stack, TextInput as Input, Text, SegmentedControl, Box, Group, Flex } from '@mantine/core';
3+
import { LockIcon } from '@assets/icons/Lock.icon';
34
import { useForm, Controller } from 'react-hook-form';
45
import { useFocusTrap } from '@mantine/hooks';
56

67
import { Button } from '@ui/button';
78
import { ITemplate, TemplateModeEnum } from '@impler/shared';
9+
import { ImportConfigEnum } from '@types';
810
import { SAMPLE_DATE_FORMATS, VARIABLES } from '@config';
911
import { MultiSelect } from '@ui/multi-select';
1012
import { validateDateFormatString } from '@shared/utils';
@@ -63,11 +65,24 @@ export function UpdateImportForm({ onSubmit, data, isAutoImportAvailable }: Upda
6365
render={({ field }) => (
6466
<SegmentedControl
6567
fullWidth
66-
value={field.value || 'manual'}
68+
value={field.value || ImportConfigEnum.MANUAL}
6769
onChange={field.onChange}
6870
data={[
69-
{ label: 'Manual', value: 'manual' },
70-
{ label: 'Automatic', value: 'automatic', disabled: !isAutoImportAvailable },
71+
{ label: 'Manual', value: ImportConfigEnum.MANUAL },
72+
{
73+
value: ImportConfigEnum.AUTOMATED,
74+
disabled: !isAutoImportAvailable,
75+
label: (
76+
<Group position="center" spacing={4}>
77+
{!isAutoImportAvailable && (
78+
<Flex>
79+
<LockIcon size="md" />
80+
</Flex>
81+
)}
82+
Automatic
83+
</Group>
84+
),
85+
},
7186
]}
7287
/>
7388
)}

0 commit comments

Comments
 (0)