gitscope
← marzneshin / v0.3.1 / 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
 1import {
 2	FormControl,
 3	FormField,
 4	FormItem,
 5	FormLabel,
 6	FormMessage,
 7	Select,
 8	SelectContent,
 9	SelectItem,
10	SelectTrigger,
11	SelectValue,
12} from "@marzneshin/components";
13import { useFormContext } from "react-hook-form";
14import { useTranslation } from "react-i18next";
15
16export const FingerprintField = () => {
17	const { t } = useTranslation();
18	const form = useFormContext();
19	return (
20		<FormField
21			control={form.control}
22			name="fingerprint"
23			render={({ field }) => (
24				<FormItem className="w-full">
25					<FormLabel>{t("fingerprint")}</FormLabel>
26					<Select onValueChange={field.onChange} defaultValue={field.value}>
27						<FormControl>
28							<SelectTrigger>
29								<SelectValue placeholder="Select fingerprint" />
30							</SelectTrigger>
31						</FormControl>
32						<SelectContent>
33							<SelectItem value="none">None</SelectItem>
34							<SelectItem value="chrome">Chrome</SelectItem>
35							<SelectItem value="firefox">Firefox</SelectItem>
36							<SelectItem value="safari">Safari</SelectItem>
37							<SelectItem value="ios">iOS</SelectItem>
38							<SelectItem value="android">Android</SelectItem>
39							<SelectItem value="edge">Edge</SelectItem>
40							<SelectItem value="360">360</SelectItem>
41							<SelectItem value="qq">qq</SelectItem>
42							<SelectItem value="random">Random</SelectItem>
43							<SelectItem value="randomized">Randomized</SelectItem>
44						</SelectContent>
45					</Select>
46					<FormMessage />
47				</FormItem>
48			)}
49		/>
50	);
51};