d606f8371c
Ports the weather check added to stroy-bot-main on 2026-10-16: daily station weather, report positions with weather per shift and the AI assessment of working conditions. Opens as ?page=weather&start=&end= instead of the #weathercheck hash, and hub dates survive the way back. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
27 lines
954 B
TypeScript
27 lines
954 B
TypeScript
import * as React from 'react';
|
|
import { Badge } from '@tnsu/ui-kit';
|
|
import { IWeatherPosition } from './weatherTypes';
|
|
import { EmptyValue } from './EmptyValue';
|
|
import { WEATHER_TEXTS } from './texts';
|
|
import styles from './WeatherPage.module.scss';
|
|
|
|
const TEXTS = WEATHER_TEXTS.positions;
|
|
|
|
interface Props {
|
|
position: IWeatherPosition;
|
|
}
|
|
|
|
/** «Акт простоя»: рекомендован (с причиной) / не требуется / нет оценки. */
|
|
export const DowntimeActCell: React.FC<Props> = ({ position }) => {
|
|
if (position.downtime_act_recommended === false) {
|
|
return <Badge variant="success">{TEXTS.downtimeNotRequired}</Badge>;
|
|
}
|
|
if (position.downtime_act_recommended !== true) return <EmptyValue />;
|
|
return (
|
|
<>
|
|
<Badge variant="danger">{TEXTS.downtimeRecommended}</Badge>
|
|
{position.downtime_act_reason && <div className={styles.reason}>{position.downtime_act_reason}</div>}
|
|
</>
|
|
);
|
|
};
|