import { isPlainObject } from 'lodash'; import { useMemo } from 'react'; import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow, } from '@/components/ui/table'; interface ServiceDetailProps { content?: any; } function ServiceDetail({ content }: ServiceDetailProps) { const contentElement = useMemo(() => { if (Array.isArray(content) && content.every(isPlainObject)) { const headers = Object.keys(content[0]); return (
{key}
{JSON.stringify(value)}
{typeof content === 'string'
? content
: JSON.stringify(content, null, 2)}