import React from 'react'; import { Tab } from './Tab'; import { TabPanel } from './TabPanel'; import './TabPanels.scss'; export type TabPanelsProps = { panels: Tab[]; activePanel: string; }; export const TabPanels: React.FC = ({ panels, activePanel }) => { return (
{panels .filter(tab => tab.name === activePanel) .map(tab => ( {tab.panel} ))}
); };