import React, { useContext } from 'react'; import styled from 'styled-components'; import { coursesContext } from '../contexts/CoursesProvider'; type ButtonProps = { direction: 'left' | 'right'; }; const Wrapper = styled.div` display: flex; justify-content: space-around; `; const StyledButton = styled.button` width: 100px; height: 100px; background-color: ${({ direction }) => (direction === 'left' ? 'red' : 'blue')}; `; type SchedulerHistoryNavigationProps = { commisionDate?: Date; changeCurrentTimetable: (value: number) => void; }; export const SchedulerHistoryNavigation = ({ commisionDate, changeCurrentTimetable, }: SchedulerHistoryNavigationProps) => { return ( { console.log('left clicked'); changeCurrentTimetable(-1); }} > LEFT {commisionDate} { console.log('right clicked'); changeCurrentTimetable(1); }} > RIGHT ); };