/* Copyright (C) 2017 Cloudbase Solutions SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ import React from 'react' import { observer } from 'mobx-react' import styled from 'styled-components' import Button from '@src/components/ui/Button' import DetailsNavigation from '@src/components/modules/NavigationModule/DetailsNavigation' import MainDetails from '@src/components/modules/TransferModule/MainDetails' import Tasks from '@src/components/modules/TransferModule/Tasks' import type { Instance } from '@src/@types/Instance' import type { Endpoint, StorageBackend } from '@src/@types/Endpoint' import type { Field } from '@src/@types/Field' import { MigrationItemDetails } from '@src/@types/MainItem' import { MinionPool } from '@src/@types/MinionPool' import { Network } from '@src/@types/Network' import { ThemeProps } from '@src/components/Theme' const Wrapper = styled.div` display: flex; justify-content: center; ` const Buttons = styled.div` margin-top: 24px; & > button:last-child { float: right; } ` const DetailsBody = styled.div` ${ThemeProps.exactWidth(ThemeProps.contentWidth)} ` const NavigationItems = [ { label: 'Migration', value: '', }, { label: 'Tasks', value: 'tasks', }, ] type Props = { item: MigrationItemDetails | null, itemId: string minionPools: MinionPool[] detailsLoading: boolean, storageBackends: StorageBackend[] instancesDetails: Instance[], instancesDetailsLoading: boolean, networks: Network[], sourceSchema: Field[], sourceSchemaLoading: boolean, destinationSchema: Field[], destinationSchemaLoading: boolean, endpoints: Endpoint[], page: string, onDeleteMigrationClick: () => void, } @observer class MigrationDetailsContent extends React.Component { renderBottomControls() { return ( ) } renderMainDetails() { if (this.props.page !== '') { return null } return ( ) } renderTasks() { if (this.props.page !== 'tasks' || !this.props.item || !this.props.item.tasks) { return null } return ( ) } render() { return ( {this.renderMainDetails()} {this.renderTasks()} ) } } export default MigrationDetailsContent