import React from 'react'
import {
BusinessInformation as BusinessInformationController,
useLanguage
} from 'ordering-components/native'
import { OText } from '../shared'
import {
BusinessInformationContainer,
WrapMainContent,
GrayBackground,
WrapScheduleBlock,
ScheduleBlock,
WrapBusinessMap,
InnerContent
} from './styles'
import { StyleSheet } from 'react-native'
import { BusinessBasicInformation } from '../BusinessBasicInformation'
import { BusinessInformationParams } from '../../types'
import { GoogleMap } from '../GoogleMap'
const BusinessInformationUI = (props: BusinessInformationParams) => {
const {
businessState,
businessSchedule,
businessLocation
} = props
const [, t] = useLanguage()
const daysOfWeek = [
t('SUNDAY_ABBREVIATION', 'Sun'),
t('MONDAY_ABBREVIATION', 'Mon'),
t('TUESDAY_ABBREVIATION', 'Tues'),
t('WEDNESDAY_ABBREVIATION', 'Wed'),
t('THURSDAY_ABBREVIATION', 'Thur'),
t('FRIDAY_ABBREVIATION', 'Fri'),
t('SATURDAY_ABBREVIATION', 'Sat')
]
const scheduleFormatted = ({ hour, minute } : {hour : number | string, minute : number | string}) => {
const checkTime = (val : number | string) => val < 10 ? `0${val}` : val
return `${checkTime(hour)}:${checkTime(minute)}`
}
return (
{t('BUSINESS_LOCATION', 'Business Location')}
{businessLocation.location && (
)}
{businessState?.business?.address}
{t('BUSINESS_OPENING_TIME', 'Business Opening Time')}
{businessSchedule && businessSchedule?.length > 0 && (
{businessSchedule.map((schedule: any, i: number) => (
{daysOfWeek[i]}
{scheduleFormatted(schedule.lapses[0].open)}
{scheduleFormatted(schedule.lapses[0].close)}
))}
)}
)
}
const styles = StyleSheet.create({
wrapMapStyle: {
borderRadius: 10,
overflow: 'hidden',
marginTop: 20,
marginBottom: 10
}
})
export const BusinessInformation = (props : BusinessInformationParams) => {
const BusinessInformationProps = {
...props,
UIComponent: BusinessInformationUI
}
return
}