import { getDates } from 'src/utils/date' import { shortName } from 'src/models/collective' const now = new Date() const dates = getDates(now) const isToday = weekDayIndex => (now.getDay() - 1) === weekDayIndex const weekDay = weekDayIndex => dates[weekDayIndex] const short = shortName const todayClass = i => isToday(i) ? 'current' : '' const HeadDay = ({ i, children }) => (

{children}

{weekDay(i)}

) const days = [ 'Понедельник', 'Вторник', 'Среда', 'Четверг', 'Пятница', 'Суббота', ] export const Schedule = ({ groups }) => (
Гр.
{days.map((day, index) => ( {day} ))}
{groups.map((group, index) => ( ))}
) const GroupRow = ({ name, time, week }) => (

{name}

{time}

{week.map((day, index) => ( ))}
) const Group = ({ day, dayIndex }) => (
{day.map((lesson, index) => ( ))}
) const Cell = ({ course, teacher, time }) => (
{time .map(range => ({ range })) .map((range, index) => ( ))}
) const Lesson = ({ title, url }) => (

{url ? ( {title} ) : ( {title} ) }

) const Teacher = ({ name, url }) => (

{url ? ( {short(name)} ) : ( {short(name)} ) }

) const TimeRange = ({ range }) => (

{(range || []).join(' — ')}

)