import React, { Fragment } from 'react'; import { I18n } from '@lingui/react'; import { Trans, t } from '@lingui/macro'; import { Card, CardHeader, CardBody, PageSection, PageSectionVariants } from '@patternfly/react-core'; import { Switch, Link, Route } from 'react-router-dom'; import Tab from '../../../components/Tabs/Tab'; import Tabs from '../../../components/Tabs/Tabs'; import getTabName from '../utils'; const OrganizationDetail = ({ location, match, parentBreadcrumbObj, organization, params, currentTab }) => { // TODO: set objectName by param or through grabbing org detail get from api const { medium } = PageSectionVariants; const tabList=['details', 'access', 'teams', 'notifications']; const deleteResourceView = () => ( {`deleting ${currentTab} association with orgs `} {`confirm removal of ${currentTab}/cancel and go back to ${currentTab} view.`} ); const addResourceView = () => ( {`adding ${currentTab} `} {`save/cancel and go back to ${currentTab} view`} ); const resourceView = () => ( {`${currentTab} detail view `} {`add ${currentTab}`} {' '} {`delete ${currentTab}`} ); return ( {({ i18n }) => ( {tabList.map(tab => ( {getTabName(tab)} ))} )} {(currentTab && currentTab !== 'details') ? ( deleteResourceView()} /> addResourceView()} /> resourceView()} /> ) : ( {'detail view '} {'edit'} )} ); }; export default OrganizationDetail;