import * as React from 'react'; import { BookingCalendarTimeAxisClasses, bookingCalendarTimeAxisDefaultClasses, } from './classes'; import classNames from 'classnames'; import { GridItem } from '../utils'; import { Duration } from 'moment'; import { GetMomentFormatFunctionType } from '..'; export interface BookingCalendarTimeAxisProps extends BookingCalendarTimeAxisClasses { items: GridItem[]; bestStep: Duration; getMomentFormatFunction: GetMomentFormatFunctionType; } export function BookingCalendarTimeAxis(props: BookingCalendarTimeAxisProps) { const { className, timeAxisItemClassName, items, getMomentFormatFunction, bestStep, } = props; const svgRef = React.useRef(); return ( {items.map((item, key) => ( {item.date.format(getMomentFormatFunction?.(item.date, bestStep))} ))} ); }