// @flow import * as React from 'react'; import { DIALOGS, IDialogs } from '$constants/dialogs'; import * as classnames from 'classnames'; import { AppInfoDialog } from '$components/dialogs/AppInfoDialog'; import { Icon } from '$components/panels/Icon'; import { MapListDialog } from '$components/dialogs/MapListDialog'; import * as ActionCreators from "$redux/user/actions"; import { StatelessComponent } from "react"; interface Props { dialog: keyof IDialogs, dialog_active: Boolean, setDialogActive: typeof ActionCreators.setDialogActive, } const LEFT_DIALOGS = { [DIALOGS.MAP_LIST]: MapListDialog, [DIALOGS.APP_INFO]: AppInfoDialog, }; export const LeftDialog = ({ dialog, dialog_active, setDialogActive }: Props) => ( { Object.keys(LEFT_DIALOGS).map(item => (
{ dialog && LEFT_DIALOGS[item] && React.createElement(LEFT_DIALOGS[item]) }
setDialogActive(false)}>
)) }
);