"use client"; import ExpandMoreIcon from "@mui/icons-material/ExpandMore"; import { Accordion, AccordionDetails, AccordionSummary, Box, Button, Card, CardContent, Chip, FormControlLabel, Grid, MenuItem, Stack, TextField, Typography, Checkbox } from "@mui/material"; import type { AccessList } from "@/src/lib/models/access-lists"; import type { Certificate } from "@/src/lib/models/certificates"; import type { ProxyHost } from "@/src/lib/models/proxy-hosts"; import { createProxyHostAction, deleteProxyHostAction, updateProxyHostAction } from "./actions"; type Props = { hosts: ProxyHost[]; certificates: Certificate[]; accessLists: AccessList[]; }; export default function ProxyHostsClient({ hosts, certificates, accessLists }: Props) { return ( Proxy Hosts Define HTTP(S) reverse proxies managed by Caddy with built-in TLS orchestration. {hosts.map((host) => ( {host.name} {host.domains.join(", ")} } sx={{ px: 0 }}> Edit configuration updateProxyHostAction(host.id, formData)} spacing={2}> Managed by Caddy {certificates.map((cert) => ( {cert.name} ))} None {accessLists.map((list) => ( {list.name} ))} ))} Create proxy host Managed by Caddy {certificates.map((cert) => ( {cert.name} ))} None {accessLists.map((list) => ( {list.name} ))} } label="Force HTTPS" /> } label="HSTS" /> } label="Allow WebSocket" /> } label="Preserve host header" /> } label="Enabled" /> ); } function HiddenCheckboxField({ name, defaultChecked, label }: { name: string; defaultChecked: boolean; label: string }) { return ( } label={label} /> ); }