import * as React from 'react'; import { Icon } from '$components/panels/Icon'; import { routerCancel as routerCancelAction, routerSubmit as routerSubmitAction, } from "$redux/user/actions"; import classnames from "classnames"; type Props = { routerPoints: number, width: number, is_routing: boolean, routerCancel: typeof routerCancelAction, routerSubmit: typeof routerSubmitAction, } const noPoints = ({ routerCancel }: { routerCancel: typeof routerCancelAction }) => (
Укажите первую точку на карте
Отмена
); const firstPoint = ({ routerCancel }: { routerCancel: typeof routerCancelAction }) => (
УКАЖИТЕ СЛЕДУЮЩУЮ ТОЧКУ
Отмена
); const draggablePoints = ({ routerCancel, routerSubmit }: { routerCancel: typeof routerCancelAction, routerSubmit: typeof routerSubmitAction, }) => (
Продолжайте маршрут
Отмена
Применить
); export const RouterDialog = ({ routerPoints, routerCancel, routerSubmit, width, is_routing, }: Props) => (
{!routerPoints && noPoints({ routerCancel })} {routerPoints === 1 && firstPoint({ routerCancel })} {routerPoints >= 2 && draggablePoints({ routerCancel, routerSubmit })}
);