@coko/client
Version:
Client side common code for coko apps
97 lines (94 loc) • 2.95 kB
JavaScript
import { grid as e } from "../../toolkit/themeHelper.js";
import "../../toolkit/index.js";
import t from "../common/Ribbon.js";
import n from "../common/InputNumber.js";
import r from "../common/Switch.js";
import "../common/index.js";
import i from "./SearchBox.js";
import a from "./SuggestedReviewer.js";
import o from "./ReviewerTable.js";
import { useState as s } from "react";
import c from "styled-components";
import { jsx as l, jsxs as u } from "react/jsx-runtime";
//#region src/ui/assignReviewers/AssignReviewers.tsx
var d = c.div``, f = c.div`
display: flex;
justify-content: space-between;
margin-bottom: ${e(3)};
label:last-of-type {
margin-top: 0;
}
`, p = c.div``, m = c.div`
margin-bottom: ${e(1)};
`, h = c.div`
align-items: center;
display: flex;
justify-content: space-between;
margin: ${e(2)} ${e(4)};
> div > button:not(:last-child) {
margin-right: ${e(1)};
}
`, g = c(i)`
margin-bottom: ${e(1)};
`, _ = c(t)`
margin-bottom: ${e(1)};
`, v = ({ additionalReviewerColumns: e = [], additionalSearchFields: t = [], amountOfReviewers: i, automate: c, canInviteMore: v, canDismissReviewer: y = !1, className: b, onAddReviewers: x, onAmountOfReviewersChange: S, onAutomationChange: C, onClickInvite: w, onClickRemoveRow: T, onClickRevokeInvitation: E, onSearch: D, onTableChange: O, reviewerPool: k = [], searchPlaceholder: A, suggestedReviewerName: j, useShowEmail: M = !1 }) => {
let [N, P] = s(!1), [F, I] = s(!1);
return /* @__PURE__ */ u(d, {
className: b,
children: [
j && /* @__PURE__ */ l(f, { children: /* @__PURE__ */ l(p, { children: j && /* @__PURE__ */ l(a, { name: j }) }) }),
/* @__PURE__ */ l(g, {
additionalSearchFields: t,
onAdd: x,
onSearch: D,
searchPlaceholder: A
}),
/* @__PURE__ */ u(m, { children: [/* @__PURE__ */ u(_, {
status: c ? "success" : null,
children: ["Automation is ", c ? "on" : "off"]
}), /* @__PURE__ */ u(h, { children: [
/* @__PURE__ */ l(p, { children: /* @__PURE__ */ l(r, {
checked: c,
disabled: !F,
label: "Automate invites",
labelPosition: "left",
onChange: C
}) }),
/* @__PURE__ */ l(p, { children: /* @__PURE__ */ l(r, {
checked: F,
label: "Sort reviewers manually",
labelPosition: "left",
onChange: I
}) }),
M && /* @__PURE__ */ l(p, { children: /* @__PURE__ */ l(r, {
checked: N,
label: "Show reviewer emails",
labelPosition: "left",
onChange: () => P(!N)
}) }),
/* @__PURE__ */ l(n, {
disabled: c,
label: "Maximum reviewers from pool",
min: 1,
onChange: S,
value: i
})
] })] }),
/* @__PURE__ */ l(o, {
additionalColumns: e,
canDismissReviewer: y,
canInviteMore: v,
manualSorting: F,
onChange: O,
onInvite: w,
onRemoveRow: T,
onRevokeInvitation: E,
reviewers: k,
showEmails: N
})
]
});
};
//#endregion
export { v as default };