synapse-react-client
Version:
[](https://badge.fury.io/js/synapse-react-client) [](https://github.com/prettier/prettie
69 lines (68 loc) • 2.1 kB
JavaScript
import { jsx as t, Fragment as i, jsxs as s } from "react/jsx-runtime";
import { Box as u, Typography as c, Button as E } from "@mui/material";
import { TERMS_OF_USE_ACCESS_REQUIREMENT_CONCRETE_TYPE_VALUE as d, ACT_ACCESS_REQUIREMENT_CONCRETE_TYPE_VALUE as C } from "@sage-bionetworks/synapse-types";
import { useState as p } from "react";
import { ConfirmationDialog as T } from "../ConfirmationDialog/ConfirmationDialog.js";
import { getOldAccessRequirementInstructions as _ } from "./GovernanceUtils.js";
function I(l) {
const { accessRequirement: o, onConfirmDelete: a, allowDelete: m = !1 } = l, [f, n] = p(!1), r = _(o);
return /* @__PURE__ */ t(i, { children: !!r && /* @__PURE__ */ s(
u,
{
sx: {
mb: 2
},
children: [
/* @__PURE__ */ t(
c,
{
variant: "body1",
sx: {
fontWeight: 700,
mb: 1
},
children: "Legacy text-only instructions"
}
),
/* @__PURE__ */ t(
c,
{
variant: "body1",
sx: {
mb: 1
},
children: r
}
),
m && /* @__PURE__ */ s(i, { children: [
/* @__PURE__ */ t(
E,
{
variant: "contained",
color: "error",
onClick: () => n(!0),
children: "Delete old instructions"
}
),
/* @__PURE__ */ t(
T,
{
open: f,
title: "Are you sure?",
content: "Deleting the old instructions cannot be undone. Continue?",
onCancel: () => n(!1),
onConfirm: () => {
const e = { ...o };
e.concreteType === d ? e.termsOfUse = void 0 : e.concreteType === C && (e.actContactInfo = void 0), a(e), n(!1);
}
}
)
] })
]
}
) });
}
export {
I as AccessRequirementTextInstructions
};
//# sourceMappingURL=AccessRequirementTextInstructions.js.map