import React from 'react' import styles from './styles.module.css' interface ScheduleMobileProps { data?: any days?: any isMobile?: boolean openStoreEveryDay?: any showTiming?: any style?: React.CSSProperties handleClick?: (number: number) => void handleHourPmAM?: (string: string) => void } export const ScheduleMobile: React.FC = ({ data, days, isMobile, openStoreEveryDay, showTiming, style, handleClick, handleHourPmAM = (string: string) => string, }) => { return (
{data?.map((s: any, i: number) => { const start = handleHourPmAM(s.schHoSta) const end = handleHourPmAM(s.schHoEnd) const handleDivClick = () => { if (!openStoreEveryDay && handleClick) { handleClick(Number(s.schDay || s.day)) } } const handleDivKeyDown = (event: React.KeyboardEvent) => { if ((event.key === 'Enter' || event.key === ' ') && !openStoreEveryDay && handleClick) { handleClick(Number(s.schDay || s.day)) } } return (
{days[Number(s.schDay ?? s.day)]}
{start} - {end}
) })}
) }