import React from 'react'; import cn from 'classnames'; import { Grid, AccessoryIcon } from 'indigo-react'; export default function Accordion({ className, views, options, currentTab, onTabChange, // Tab props ...rest }) { const Tab = views[currentTab]; return ( {options.map((option, i) => { const isActive = option.value === currentTab; return ( onTabChange(isActive ? undefined : option.value) }> {option.text} {option.disabled && ( {option.disabled} )}
{isActive ? '▲' : '▼'}
{isActive && }
); })}
); }