import React from "react"; import { Table } from "react-bootstrap"; const TableFromObject = (props: { data: string | { [key: string]: string }; }) => { const { data } = props; if (!data) return ; if (typeof data === "string") return {data}; const keys = Object.keys(data); return ( {keys.map((key: string) => typeof data[key] === "object" ? ( ) : ( ) )}
{key} {data[key]}
); }; export default TableFromObject;