import React from 'react'; import LegendEntry from './entry'; import LegendHeader from './header'; import { LegendProps, LegendLabel } from './types'; const Legend: React.FC = ({ title, entries, size, headerProps, entryProps, rectProps, onEntryClick, ...props }) => { const itemHeight = size.height / (entries.length + 1); return ( { entries.map( (entry: LegendLabel, i: number) => ( onEntryClick && onEntryClick(i)} {...entryProps} /> ))} ); }; export default Legend;