import Stack from "@mui/material/Stack"; import Typography from "@mui/material/Typography"; import Divider from "@mui/material/Divider"; import Box from "@mui/material/Box"; import { useTheme } from "@mui/material/styles"; import { useGet } from "@/hooks/UseApi"; import { StatBox } from "@/components/design-elements"; import { config as clientConfig } from "@/config"; type EnvConfig = { NODE_ENV: string; DEPLOYMENT_MODE: string; LOG_LEVEL: string; ORIGIN: string; JWT_SECRET: string; PORT: number; PAGESPEED_API_KEY: string; SMTP_HOST: string; SMTP_PORT: number; SMTP_USER: string; SMTP_PASS: string; STRIPE_SECRET: string; STRIPE_WEBHOOK_SECRET: string; }; export default function DiagnosticsConfigTab() { const theme = useTheme(); const { response, loading, error } = useGet<{ message: string; data: EnvConfig; }>("/diagnostic/env", {}, { refreshInterval: clientConfig.GLOBAL_REFRESH }); const data = response?.data; const clientEntries = Object.entries(clientConfig as Record); if (!data && !loading && !error) return null; const totalKeys = data ? Object.keys(data).length : 0; return ( {data && ( Server environment }> {Object.entries(data).map(([key, value]) => ( {key} {String(value)} ))} )} Client runtime config }> {clientEntries.map(([key, value]) => ( {key} {String(value)} ))} ); }