// @flow import * as React from 'react'; import { Icon } from '$components/panels/Icon'; import { MapListDialog } from "$components/dialogs/MapListDialog"; import { Tooltip } from "$components/panels/Tooltip"; import { ReactElement } from "react"; import classnames from 'classnames'; import { toggleRouteStarred } from "$redux/user/actions"; interface Props { tab: string, _id: string, title: string, distance: number, is_public: boolean, is_admin: boolean, is_starred: boolean, openRoute: typeof MapListDialog.openRoute, toggleStarred: typeof MapListDialog.toggleStarred, startEditing: typeof MapListDialog.startEditing, stopEditing: typeof MapListDialog.stopEditing, showMenu: typeof MapListDialog.showMenu, hideMenu: typeof MapListDialog.hideMenu, showDropCard: typeof MapListDialog.showDropCard, } export const RouteRowView = ({ title, distance, _id, openRoute, tab, startEditing, showMenu, showDropCard, hideMenu, is_admin, is_starred, toggleStarred, }: Props): ReactElement => (
{ (tab === 'all' || tab === 'starred') && is_admin &&
{ is_starred ? : }
}
openRoute(_id)} >
{ (tab === 'mine' || !is_admin) && is_starred &&
} {(title || _id)}
{_id} {(distance && `${distance} km`) || '0 km'}
{ tab === 'mine' &&
Удалить
Редактировать
}
);