UNPKG

react-weekly-table

Version:

React weekly scheduler <br/> By default build time ranges for a week, supports up to 31 days <br/> Can work with different timezones, data always return to UTC+0

23 lines (22 loc) 1.06 kB
import { jsx as _jsx } from "react/jsx-runtime"; import { useCells, useScheduler } from '../providers'; /** * Days of week component (columns) */ export const SchedulerHeader = () => { const { widthStep } = useCells(); const { headerHeightProp, columns } = useScheduler(); return (_jsx("div", Object.assign({ id: 'schedulerHeader', className: 'scheduler-header', style: { position: 'relative', userSelect: 'none', display: 'inline-flex', height: `${headerHeightProp}px`, maxHeight: `${headerHeightProp}px`, } }, { children: columns === null || columns === void 0 ? void 0 : columns.map((col) => { return (_jsx("div", Object.assign({ id: 'schedulerHeaderColumn', className: 'scheduler-text scheduler-header-column', style: { display: 'inline-flex', minWidth: `${widthStep}px`, width: `${widthStep}px`, } }, { children: col.full }), col.weight)); }) }))); };