import { TimelineStore } from './TimelineStore'; import * as React from 'react'; import { REMOVE_FOR_DOWNLOAD_CLASSNAME } from './lib/helpers'; import classNames from 'classnames'; export type CustomTrackSpecification = { renderHeader: (store: TimelineStore) => any; // any = react renderable, string or element or null or etc. renderTrack: (store: TimelineStore) => React.ReactElement; height: (store: TimelineStore) => number; labelForExport: string; disableHover?: boolean; }; export interface ICustomTrackProps { store: TimelineStore; specification: CustomTrackSpecification; width: number; y: number; handleTrackHover: (e: React.MouseEvent) => void; disableHover?: boolean; } const CustomTrack: React.FunctionComponent = function({ store, specification, width, y, handleTrackHover, disableHover, }: ICustomTrackProps) { return ( {specification.renderTrack(store)} ); }; export default CustomTrack;