diff --git a/frontend/src/app/dashboard/companies/page.tsx b/frontend/src/app/dashboard/companies/page.tsx index a668132..a234107 100644 --- a/frontend/src/app/dashboard/companies/page.tsx +++ b/frontend/src/app/dashboard/companies/page.tsx @@ -28,6 +28,33 @@ const companyDateFormatter = new Intl.DateTimeFormat("en-US", { timeZone: "UTC", }) +// Helper to format description (handles JSON or plain text) +const formatDescription = (description: string | undefined) => { + if (!description) return null + + try { + const parsed = JSON.parse(description) + if (typeof parsed === 'object' && parsed !== null) { + return ( +
+ {Object.entries(parsed).map(([key, value]) => ( +
+
+ {key.replace(/([A-Z])/g, ' $1').replace(/_/g, ' ')} +
+
{String(value)}
+
+ ))} +
+ ) + } + } catch { + // Not JSON, return as plain text + } + + return

{description}

+} + export default function AdminCompaniesPage() { const router = useRouter() const [companies, setCompanies] = useState([]) @@ -418,7 +445,9 @@ export default function AdminCompaniesPage() { {selectedCompany.description && (
-

{selectedCompany.description}

+
+ {formatDescription(selectedCompany.description)} +
)}