import React from 'react' import { Tabs, TabList, Tab, TabPanels, TabPanel, Box } from "@chakra-ui/react"; import { renderJSON } from "../renderJson"; export type TabType = { title: string content: string | any[] json: any attrs?: { title: string } } export type TapsViewProps = { tabs: TabType[] } export function TabsView({ tabs }: TapsViewProps) { return ( {tabs.map(({ attrs, title }, index) => ( {attrs?.title || title} ))} {tabs.map(({ title, content, json }, index) => { // Nový formát if (typeof content === 'object') { return ( ) } // Zpětná kompatibilita if (typeof json === "string") { json = JSON.parse(json) } return ( ) })} ) }