import React from "react"; import Admonition from "@theme/Admonition"; import DeviceSelector from "./components/DeviceSelector"; import HardwareOptions from "./components/HardwareOptions"; import PortConfigSection from "./components/PortConfig"; import StoragePaths from "./components/StoragePaths"; import NvidiaGpuConfig from "./components/NvidiaGpuConfig"; import OtherOptions from "./components/OtherOptions"; import GeneratedOutput from "./components/GeneratedOutput"; import { useConfigGenerator } from "./hooks/useConfigGenerator"; import styles from "./styles.module.css"; /** * Simple markdown-link-to-React renderer for help text. * Only supports [text](url) syntax — no nested brackets. */ function renderHelpText(text: string): React.ReactNode { const parts = text.split(/(\[[^\]]+\]\([^)]+\))/g); return parts.map((part, i) => { const match = part.match(/^\[([^\]]+)\]\(([^)]+)\)$/); if (match) { return ( {match[1]} ); } return {part}; }); } export default function DockerComposeGenerator() { const { deviceId, device, hardwareEnabled, portEnabled, nvidiaGpuCount, nvidiaGpuDeviceId, configPath, mediaPath, rtspPassword, timezone, shmSize, shmSizeError, gpuDeviceIdError, configPathError, mediaPathError, hasAnyHardware, generatedYaml, selectDevice, toggleHardware, togglePort, handleShmSizeChange, handleConfigPathChange, handleMediaPathChange, handleNvidiaGpuCountChange, handleNvidiaGpuDeviceIdChange, setRtspPassword, setTimezone, isHardwareDisabled, } = useConfigGenerator(); return (
{device.helpText && ( {renderHelpText(device.helpText)} )} {device.needsNvidiaConfig && ( )}
); }