gitscope
https://dev.kronoz.win/r/marzneshin.git
dashboard/src/modules/hosts/dialogs/mutation/fields/mux-settings/protocol.tsx · v0.7.2
Source
1 4056c66 Dawsh 1y ago import {
2 4056c66 Dawsh 1y ago FormControl,
3 4056c66 Dawsh 1y ago FormField,
4 4056c66 Dawsh 1y ago FormItem,
5 4056c66 Dawsh 1y ago FormLabel,
6 4056c66 Dawsh 1y ago Select,
7 4056c66 Dawsh 1y ago SelectContent,
8 4056c66 Dawsh 1y ago SelectItem,
9 4056c66 Dawsh 1y ago SelectTrigger,
10 4056c66 Dawsh 1y ago SelectValue,
11 4056c66 Dawsh 1y ago } from "@marzneshin/common/components";
12 4056c66 Dawsh 1y ago import { useTranslation } from "react-i18next";
13 4056c66 Dawsh 1y ago
14 4056c66 Dawsh 1y ago export const ProtocolField = ({
15 4056c66 Dawsh 1y ago updater,
16 4056c66 Dawsh 1y ago }: {
17 4056c66 Dawsh 1y ago updater: (field: string, value: any) => void;
18 4056c66 Dawsh 1y ago }) => {
19 4056c66 Dawsh 1y ago const { t } = useTranslation();
20 4056c66 Dawsh 1y ago return (
21 4056c66 Dawsh 1y ago <FormField
22 4056c66 Dawsh 1y ago name="mux_settings.protocol"
23 4056c66 Dawsh 1y ago render={({ field }) => (
24 4056c66 Dawsh 1y ago <FormItem>
25 4056c66 Dawsh 1y ago <FormLabel>{t("protocol")}</FormLabel>
26 4056c66 Dawsh 1y ago <Select
27 4056c66 Dawsh 1y ago onValueChange={(value) =>
28 4056c66 Dawsh 1y ago updater("mux_settings.protocol", value)
29 4056c66 Dawsh 1y ago }
30 4056c66 Dawsh 1y ago defaultValue={field.value ? field.value : "mux_cool"}
31 4056c66 Dawsh 1y ago >
32 4056c66 Dawsh 1y ago <FormControl>
33 4056c66 Dawsh 1y ago <SelectTrigger>
34 4056c66 Dawsh 1y ago <SelectValue placeholder="Select protocol" />
35 4056c66 Dawsh 1y ago </SelectTrigger>
36 4056c66 Dawsh 1y ago </FormControl>
37 4056c66 Dawsh 1y ago <SelectContent>
38 4056c66 Dawsh 1y ago <SelectItem value="mux_cool">Mux Cool</SelectItem>
39 4056c66 Dawsh 1y ago <SelectItem value="h2mux">h2mux</SelectItem>
40 4056c66 Dawsh 1y ago <SelectItem value="yamux">yamux</SelectItem>
41 4056c66 Dawsh 1y ago <SelectItem value="smux">smux</SelectItem>
42 4056c66 Dawsh 1y ago </SelectContent>
43 4056c66 Dawsh 1y ago </Select>
44 4056c66 Dawsh 1y ago </FormItem>
45 4056c66 Dawsh 1y ago )}
46 4056c66 Dawsh 1y ago />
47 4056c66 Dawsh 1y ago );
48 4056c66 Dawsh 1y ago };