import { styled } from "@mui/material"; import { TFinalFormField } from "../../../../types"; import { SuperForm } from "../../../SuperForm"; const Root = styled("div")` display: flex; flex-direction: column; row-gap: ${({ theme }) => theme.spacing(1)}; @media (max-width: 640px) { row-gap: 0; } `; const General = () => { return ( [ { id: `ports[${index}].hostPort`, type: "text", name: `ports[${index}].hostPort`, placeholder: "Host port", required: true }, { id: `ports[${index}].containerPort`, type: "text", name: `ports[${index}].containerPort`, placeholder: "Container port" }, { id: `ports[${index}].protocol`, type: "toggle", name: `ports[${index}].protocol`, label: "Protocol", options: [ { value: "tcp", text: "TCP" }, { value: "udp", text: "UDP" } ] } ], newValue: { hostPort: "", containerPort: "", protocol: "" } }, { id: "dependsOn", type: "records", name: "dependsOn", title: "Depends on", fields: (index: number): TFinalFormField[] => [ { id: `dependsOn[${index}]`, type: "text", name: `dependsOn[${index}]`, placeholder: "Service name", required: false } ], newValue: "" }, { id: "networks", type: "records", title: "Networks", name: "networks", fields: (index: number): TFinalFormField[] => [ { id: `networks[${index}]`, type: "text", name: `networks[${index}]`, placeholder: "Network name", required: false } ], newValue: "" }, { id: "labels", type: "records", title: "Labels", name: "labels", fields: (index: number): TFinalFormField[] => [ { id: `labels[${index}].key`, type: "text", name: `labels[${index}].key`, placeholder: "Key", required: true }, { id: `labels[${index}].value`, type: "text", name: `labels[${index}].value`, placeholder: "Value", required: true } ], newValue: { key: "", value: "" } }, { id: "profiles", type: "records", title: "Profiles", name: "profiles", fields: (index: number): TFinalFormField[] => [ { id: `profiles[${index}]`, name: `profiles[${index}]`, placeholder: "Name", required: true, type: "text" } ], newValue: "" } ]} /> ); }; export default General;