import * as React from 'react'; import { formatWeatherDate, formatWeatherNumber } from './weatherFormat'; import { IWeatherDay } from './weatherTypes'; import { WeatherPhenomena } from './WeatherPhenomena'; import { WEATHER_TEXTS } from './texts'; import styles from './WeatherPage.module.scss'; const TEXTS = WEATHER_TEXTS.days; const COLUMNS = TEXTS.columns; interface Props { days: IWeatherDay[]; } /** «Погода по дням»: наблюдения метеостанции за каждый день периода. */ export const WeatherDaysTable: React.FC = ({ days }) => { if (days.length === 0) { return
{TEXTS.empty}
; } return (
{days.map((day) => ( ))}
{COLUMNS.date} {COLUMNS.observations} {COLUMNS.tempMin} {COLUMNS.tempMax} {COLUMNS.wind} {COLUMNS.gust} {COLUMNS.precipitation} {COLUMNS.phenomena}
{formatWeatherDate(day.date)} {formatWeatherNumber(day.observations)} {formatWeatherNumber(day.temp_min)} {formatWeatherNumber(day.temp_max)} {formatWeatherNumber(day.wind_max)} {formatWeatherNumber(day.gust_max)} {formatWeatherNumber(day.precipitation)}
); };