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