/** @jsxRuntime classic */ /** @jsx jsx */ import { FC, Fragment } from 'react'; import { jsx } from '@emotion/react'; import { spaceColumnContainer, spaceRowContainer } from '../../styles'; import { ECalendarView, IWeeklyViewProps } from '../../types'; import { WeekToDrop } from './WeekToDrop'; import { useMiddlewareContext } from '../../hooks/useMiddlewareContext'; export const WeeklyView: FC = ({ spaces, EventComponent, }) => { const { options } = useMiddlewareContext(); const { view = ECalendarView.VERTICAL } = options || {}; const horizontal = view === ECalendarView.HORIZONTAL; return ( {spaces.map((space) => { const columnsCount = spaces.reduce( (acc, { children }) => acc + (children.length || 1), 0 ); if (space.children.length === 0) { return (
); } else { return (
{space.children.map((item) => { return ( ); })}
); } })}
); };