import React from 'react';
import PropTypes from 'prop-types';
import { Button } from 'patternfly-react';
import { translate as __ } from 'foremanReact/common/I18n';
import SnapshotFormModal from './components/SnapshotFormModal';
import useSnapshotFormModal from './components/SnapshotFormModal/useSnapshotFormModal';
import SnapshotList from './components/SnapshotList/SnapshotList';
import './snapshotManagement.scss';
const SnapshotManagement = ({ canCreate, host, ...props }) => {
const children = [];
const { setModalOpen, setModalClosed } = useSnapshotFormModal();
const onCreateClick = () => {
setModalOpen();
};
const allowedHostAttr = ['id', 'name'];
const filteredHost = Object.keys(host)
.filter(key => allowedHostAttr.includes(key))
.reduce(
(obj, key) => ({
...obj,
[key]: host[key],
}),
{}
);
if (canCreate) {
children.push(