gitscope
← marzneshin / v0.3.0-alpha10 / dashboard/src/features/hosts/dialogs/mutation/fields/fingerprint.tsx
https://dev.kronoz.win/r/marzneshin.git
dashboard/src/features/hosts/dialogs/mutation/fields/fingerprint.tsx · TypeScript
Blame Raw
 1
 2
 3import {
 4    FormControl,
 5    FormField,
 6    FormItem,
 7    FormLabel,
 8    FormMessage,
 9    Select,
10    SelectContent,
11    SelectItem,
12    SelectTrigger,
13    SelectValue,
14} from "@marzneshin/components";
15import { useFormContext } from "react-hook-form";
16import { useTranslation } from "react-i18next";
17
18export const FingerprintField = () => {
19    const { t } = useTranslation()
20    const form = useFormContext()
21    return (
22        <FormField
23            control={form.control}
24            name="fingerprint"
25            render={({ field }) => (
26                <FormItem>
27                    <FormLabel>{t('fingerprint')}</FormLabel>
28                    <Select onValueChange={field.onChange} defaultValue={field.value}>
29                        <FormControl>
30                            <SelectTrigger>
31                                <SelectValue placeholder="Select fingerprint" />
32                            </SelectTrigger>
33                        </FormControl>
34                        <SelectContent>
35                            <SelectItem value="none">None</SelectItem>
36                            <SelectItem value="chrome">Chrome</SelectItem>
37                            <SelectItem value="firefox">Firefox</SelectItem>
38                            <SelectItem value="safari">Safari</SelectItem>
39                            <SelectItem value="ios">iOS</SelectItem>
40                            <SelectItem value="android">Android</SelectItem>
41                            <SelectItem value="edge">Edge</SelectItem>
42                            <SelectItem value="360">360</SelectItem>
43                            <SelectItem value="qq">qq</SelectItem>
44                            <SelectItem value="random">Random</SelectItem>
45                            <SelectItem value="randomized">Randomized</SelectItem>
46                        </SelectContent>
47                    </Select>
48                    <FormMessage />
49                </FormItem>
50            )}
51        />
52    )
53}