"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.DatasetTools = exports.DatasetToolStyle = void 0;
const react_1 = __importDefault(require("react"));
const DatasetToolButton_1 = require("./DatasetToolButton");
const styled_1 = __importDefault(require("@emotion/styled"));
exports.DatasetToolStyle = styled_1.default.span `
  display: flex;
  justify-content: flex-start;
  flex-wrap: wrap;
`;
const DatasetTools = ({ hasEdit, isPublic, datasetId, snapshotId, isAdmin, hasSnapshot, isDatasetAdmin, hasDerivatives, }) => {
    const isSnapshot = snapshotId;
    return (react_1.default.createElement(exports.DatasetToolStyle, null,
        react_1.default.createElement(DatasetToolButton_1.DatasetToolButton, { tooltip: 'View the dataset file tree', path: snapshotId
                ? `/datasets/${datasetId}/versions/${snapshotId}`
                : `/datasets/${datasetId}`, icon: "fa-folder", label: "Files" }),
        hasEdit && !isPublic && !isSnapshot && (react_1.default.createElement(react_1.default.Fragment, null, hasSnapshot ? (react_1.default.createElement(DatasetToolButton_1.DatasetToolButton, { tooltip: "Publicize the dataset", path: `/datasets/${datasetId}/publish`, icon: "fa-globe", label: "Publish" })) : (react_1.default.createElement(DatasetToolButton_1.DatasetToolButton, { tooltip: "Create a version to publish", path: `/datasets/${datasetId}/snapshot?publish`, icon: "fa-globe", label: "Publish" })))),
        hasEdit && !isSnapshot && (react_1.default.createElement(DatasetToolButton_1.DatasetToolButton, { tooltip: "Share this dataset with collaborators", path: `/datasets/${datasetId}/share`, icon: "fa-user", label: "Share" })),
        hasEdit && isSnapshot && (react_1.default.createElement(DatasetToolButton_1.DatasetToolButton, { tooltip: "View the Dataset Draft", path: `/datasets/${datasetId}`, icon: "fa-pencil", label: "View Draft" })),
        hasEdit && !isSnapshot && (react_1.default.createElement(DatasetToolButton_1.DatasetToolButton, { tooltip: "Create a new version of the dataset", path: `/datasets/${datasetId}/snapshot`, icon: "fa-camera", label: "Versioning" })),
        isAdmin && !isSnapshot && (react_1.default.createElement(DatasetToolButton_1.DatasetToolButton, { tooltip: "Admin Datalad Tools", path: `/datasets/${datasetId}/admin`, icon: "fa-magic", label: "Admin" })),
        react_1.default.createElement(DatasetToolButton_1.DatasetToolButton, { tooltip: "How to Download", path: snapshotId
                ? `/datasets/${datasetId}/versions/${snapshotId}/download`
                : `/datasets/${datasetId}/download`, icon: "fa-download", label: "Download" }),
        hasDerivatives && (react_1.default.createElement(DatasetToolButton_1.DatasetToolButton, { tooltip: "Available Derivatives", path: snapshotId
                ? `/datasets/${datasetId}/versions/${snapshotId}/derivatives`
                : `/datasets/${datasetId}/derivatives`, icon: "fa-cubes", label: "Derivatives" })),
        react_1.default.createElement(DatasetToolButton_1.DatasetToolButton, { tooltip: hasEdit
                ? 'A form to describe your dataset (helps colleagues discover your dataset)'
                : 'View the dataset metadata', path: snapshotId
                ? `/datasets/${datasetId}/versions/${snapshotId}/metadata`
                : `/datasets/${datasetId}/metadata`, icon: "fa-file-code", label: "Metadata" }),
        isDatasetAdmin && !isSnapshot && (react_1.default.createElement(DatasetToolButton_1.DatasetToolButton, { tooltip: "Remove your dataset from OpenNeuro", path: `/datasets/${datasetId}/delete`, icon: "fa-trash", label: "Delete" })),
        hasEdit && isSnapshot && (react_1.default.createElement(DatasetToolButton_1.DatasetToolButton, { tooltip: "Flag this version as deprecated", path: `/datasets/${datasetId}/versions/${snapshotId}/deprecate`, icon: "fa-remove", label: "Deprecate Version" }))));
};
exports.DatasetTools = DatasetTools;
