https://dev.kronoz.win/r/marzneshin.git
1import { type FC } from "react";
2import {
3 SettingsDialogProps,
4 SettingsDialog,
5 Table,
6 TableBody,
7 TableRowWithCell,
8} from "@marzneshin/components";
9import { useTranslation } from "react-i18next";
10import { HostType } from "../..";
11
12interface HostsSettingsDialogProps extends SettingsDialogProps {
13 onOpenChange: (state: boolean) => void;
14 onClose: () => void;
15 open: boolean;
16 entity: HostType;
17}
18
19export const HostSettingsDialog: FC<HostsSettingsDialogProps> = ({
20 onOpenChange,
21 open,
22 entity,
23 onClose,
24}) => {
25 const { t } = useTranslation();
26
27 return (
28 <SettingsDialog open={open} onClose={onClose} onOpenChange={onOpenChange}>
29 <Table>
30 <TableBody>
31 <TableRowWithCell label={t("remark")} value={entity.remark} />
32 <TableRowWithCell label={t("address")} value={entity.address} />
33 <TableRowWithCell label={t("port")} value={entity.port} />
34 <TableRowWithCell label={t("host")} value={entity.host} />
35 <TableRowWithCell label={t("path")} value={entity.path} />
36 <TableRowWithCell label={t("sni")} value={entity.sni} />
37 <TableRowWithCell label={t("alpn")} value={entity.alpn} />
38 </TableBody>
39 </Table>
40 </SettingsDialog>
41 );
42};