@coko/client
Version:
Client side common code for coko apps
61 lines (60 loc) • 2.05 kB
JavaScript
import { noop as e } from "../../toolkit/funcs.js";
import { grid as t } from "../../toolkit/themeHelper.js";
import "../../toolkit/index.js";
import n from "../common/Button.js";
import r from "../common/InviteStatus.js";
import "../common/index.js";
import "react";
import i from "styled-components";
import { jsx as a, jsxs as o } from "react/jsx-runtime";
import { CloseOutlined as s } from "@ant-design/icons";
//#region src/ui/assignReviewers/InviteRowProp.tsx
var c = i(r)`
font-size: 12px;
margin: 0 ${t(1)};
`, l = i.div`
display: inline-block;
`, u = i.div``, d = i.div`
&:hover {
cursor: pointer;
}
`, f = (t) => {
let { canInvite: r = !1, canDismissReviewer: i = !1, className: f, data: p, onClickInvite: m = e, onClickRemove: h = e, onClickRevokeInvitation: g = e, type: _ } = t, { id: v, invited: y, acceptedInvitation: b, rejectedInvitation: x, invitationRevoked: S, reviewSubmitted: C } = p, w = y && b && !C, T = y && b && C, E = y && x, D = y && S, O = y && !S && !b && !x, k = !y && !S;
return _ === "status" ? /* @__PURE__ */ a(l, {
className: f,
children: /* @__PURE__ */ a(c, {
reverseColors: !0,
status: w ? "success" : T ? "primary" : E || D ? "error" : O ? "success" : null,
children: w ? "accepted invitation - pending review" : T ? "review submitted" : E ? "rejected invitation" : D ? "invitation revoked" : O ? "invited" : k ? "not invited" : null
})
}) : _ === "action" ? /* @__PURE__ */ o(u, {
className: f,
children: [
k && /* @__PURE__ */ a(n, {
disabled: !r,
onClick: () => m(v),
type: "primary",
children: "Invite"
}),
D && /* @__PURE__ */ a(n, {
disabled: !r,
onClick: () => m(v),
type: "primary",
children: "Reinvite"
}),
O && /* @__PURE__ */ a(n, {
onClick: () => g(v),
type: "primary",
children: "Revoke invite"
})
]
}) : _ === "remove" && (k || i) ? /* @__PURE__ */ a(d, {
className: f,
onClick: () => {
h(v);
},
children: /* @__PURE__ */ a(s, {})
}) : null;
};
//#endregion
export { f as default };