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 })}
);