@ai-matrx/records-ui 0.101.34 → 0.101.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/index.cjs +51 -27
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +29 -5
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog — @ai-matrx/records-ui
|
|
2
2
|
|
|
3
|
+
## 0.101.35
|
|
4
|
+
|
|
5
|
+
Automatic changed-only republish (docs/metadata drift since the last tag — see
|
|
6
|
+
`git diff npm/records-ui/v0.101.34..npm/records-ui/v0.101.35 -- apps/shared/records-ui`).
|
|
7
|
+
No source changes intended and no consumer action required.
|
|
8
|
+
|
|
3
9
|
## 0.101.34
|
|
4
10
|
|
|
5
11
|
Automatic changed-only republish (docs/metadata drift since the last tag — see
|
package/dist/index.cjs
CHANGED
|
@@ -23451,8 +23451,10 @@ var import_jsx_runtime69 = require("react/jsx-runtime");
|
|
|
23451
23451
|
function useEntitySource(token, options = {}) {
|
|
23452
23452
|
const client = (0, import_react116.useRecordsClient)();
|
|
23453
23453
|
const limit = options.limit ?? 50;
|
|
23454
|
+
const search = (options.search ?? "").trim();
|
|
23454
23455
|
const [tick, setTick] = (0, import_react115.useState)(0);
|
|
23455
23456
|
const held = (0, import_react115.useRef)(0);
|
|
23457
|
+
const askedSearch = (0, import_react115.useRef)("");
|
|
23456
23458
|
const [loadingMore, setLoadingMore] = (0, import_react115.useState)(false);
|
|
23457
23459
|
const [state, setState] = (0, import_react115.useState)({
|
|
23458
23460
|
label: null,
|
|
@@ -23465,8 +23467,12 @@ function useEntitySource(token, options = {}) {
|
|
|
23465
23467
|
});
|
|
23466
23468
|
(0, import_react115.useEffect)(() => {
|
|
23467
23469
|
let cancelled = false;
|
|
23470
|
+
if (askedSearch.current !== search) {
|
|
23471
|
+
askedSearch.current = search;
|
|
23472
|
+
held.current = 0;
|
|
23473
|
+
}
|
|
23468
23474
|
const source = { kind: "entity", token };
|
|
23469
|
-
void Promise.all([client.drillDescribe({ source }), client.drillRows({ source, limit: Math.max(limit, held.current) })]).then(
|
|
23475
|
+
void Promise.all([client.drillDescribe({ source }), client.drillRows({ source, limit: Math.max(limit, held.current), ...search ? { search } : {} })]).then(
|
|
23470
23476
|
([def, page]) => {
|
|
23471
23477
|
if (cancelled) return;
|
|
23472
23478
|
if (!def.ok) return setState((s) => ({ ...s, loading: false, error: refusalSentence(def.error) || "This table could not be read." }));
|
|
@@ -23492,7 +23498,7 @@ function useEntitySource(token, options = {}) {
|
|
|
23492
23498
|
return () => {
|
|
23493
23499
|
cancelled = true;
|
|
23494
23500
|
};
|
|
23495
|
-
}, [client, token, limit, tick]);
|
|
23501
|
+
}, [client, token, limit, tick, search]);
|
|
23496
23502
|
const reload = (0, import_react115.useCallback)(() => setTick((t) => t + 1), []);
|
|
23497
23503
|
const write = (0, import_react115.useCallback)(
|
|
23498
23504
|
async (rowId, apiName, value) => {
|
|
@@ -23522,7 +23528,7 @@ function useEntitySource(token, options = {}) {
|
|
|
23522
23528
|
if (loadingMore) return;
|
|
23523
23529
|
setLoadingMore(true);
|
|
23524
23530
|
const source = { kind: "entity", token };
|
|
23525
|
-
const next = await client.drillRows({ source, limit, offset: held.current });
|
|
23531
|
+
const next = await client.drillRows({ source, limit, offset: held.current, ...search ? { search } : {} });
|
|
23526
23532
|
setLoadingMore(false);
|
|
23527
23533
|
if (!next.ok) return;
|
|
23528
23534
|
const more = next.data.rows ?? [];
|
|
@@ -23531,7 +23537,7 @@ function useEntitySource(token, options = {}) {
|
|
|
23531
23537
|
const seen = new Set(s.rows.map((r) => r.id));
|
|
23532
23538
|
return { ...s, rows: [...s.rows, ...more.filter((r) => !seen.has(r.id))] };
|
|
23533
23539
|
});
|
|
23534
|
-
}, [client, token, limit, loadingMore]);
|
|
23540
|
+
}, [client, token, limit, loadingMore, search]);
|
|
23535
23541
|
const hasMore = !state.loading && state.total > state.rows.length;
|
|
23536
23542
|
return { ...state, write, create, reload, loadMore, hasMore, loadingMore };
|
|
23537
23543
|
}
|
|
@@ -47268,9 +47274,10 @@ function usePublicReadOnly(client, organizationId, tableId, table, rights) {
|
|
|
47268
47274
|
}
|
|
47269
47275
|
|
|
47270
47276
|
// src/entityViews.tsx
|
|
47277
|
+
var import_design_system138 = require("@ai-matrx/design-system");
|
|
47271
47278
|
var import_data_table22 = require("@ai-matrx/design-system/data-table");
|
|
47272
47279
|
var import_react267 = require("react");
|
|
47273
|
-
var
|
|
47280
|
+
var import_design_system139 = require("@ai-matrx/design-system");
|
|
47274
47281
|
var import_react268 = require("@ai-matrx/records/react");
|
|
47275
47282
|
var import_jsx_runtime153 = require("react/jsx-runtime");
|
|
47276
47283
|
var entityTitleColumn = entityNameColumn;
|
|
@@ -47314,14 +47321,14 @@ function EntityBoard({ entity, groupBy, cardFields, onOpenRecord, className }) {
|
|
|
47314
47321
|
setMoving(null);
|
|
47315
47322
|
if (says) setRefused({ to, says });
|
|
47316
47323
|
};
|
|
47317
|
-
return /* @__PURE__ */ (0, import_jsx_runtime153.jsx)("div", { className: (0,
|
|
47324
|
+
return /* @__PURE__ */ (0, import_jsx_runtime153.jsx)("div", { className: (0, import_design_system139.cn)("flex min-h-40 gap-2 overflow-x-auto pb-1", className), "data-records-entity-board": column.api_name, children: lanes.map((lane) => {
|
|
47318
47325
|
const cards = rowsOf3(lane.key);
|
|
47319
47326
|
if (lane.key === "" && cards.length === 0) return null;
|
|
47320
47327
|
return /* @__PURE__ */ (0, import_jsx_runtime153.jsxs)(
|
|
47321
47328
|
"section",
|
|
47322
47329
|
{
|
|
47323
47330
|
"aria-label": lane.label,
|
|
47324
|
-
className: (0,
|
|
47331
|
+
className: (0, import_design_system139.cn)("flex w-60 shrink-0 flex-col gap-1.5 rounded-md bg-muted/40 p-1.5", over === lane.key && "ring-1 ring-ring"),
|
|
47325
47332
|
onDragOver: writable && lane.key ? (e) => {
|
|
47326
47333
|
e.preventDefault();
|
|
47327
47334
|
setOver(lane.key);
|
|
@@ -47333,7 +47340,7 @@ function EntityBoard({ entity, groupBy, cardFields, onOpenRecord, className }) {
|
|
|
47333
47340
|
/* @__PURE__ */ (0, import_jsx_runtime153.jsx)("span", { className: "truncate font-medium", children: lane.label }),
|
|
47334
47341
|
/* @__PURE__ */ (0, import_jsx_runtime153.jsx)("span", { className: "tabular-nums text-muted-foreground", children: cards.length })
|
|
47335
47342
|
] }),
|
|
47336
|
-
refused && refused.to === lane.key ? /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(
|
|
47343
|
+
refused && refused.to === lane.key ? /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(import_design_system139.ErrorBox, { className: "rounded border border-destructive/40 px-1.5 py-1 text-xs text-destructive", message: refused.says, operation: "Move a card", origin: "records-ui/entityViews" }) : null,
|
|
47337
47344
|
cards.map((row) => /* @__PURE__ */ (0, import_jsx_runtime153.jsxs)(
|
|
47338
47345
|
"article",
|
|
47339
47346
|
{
|
|
@@ -47342,7 +47349,7 @@ function EntityBoard({ entity, groupBy, cardFields, onOpenRecord, className }) {
|
|
|
47342
47349
|
e.dataTransfer.setData("text/x-entity-row", row.id);
|
|
47343
47350
|
e.dataTransfer.effectAllowed = "move";
|
|
47344
47351
|
},
|
|
47345
|
-
className: (0,
|
|
47352
|
+
className: (0, import_design_system139.cn)("flex flex-col gap-0.5 rounded border bg-card px-2 py-1.5 text-xs shadow-sm", writable && "cursor-grab", moving?.id === row.id && "opacity-60"),
|
|
47346
47353
|
"data-records-entity-card": row.id,
|
|
47347
47354
|
children: [
|
|
47348
47355
|
onOpenRecord ? /* @__PURE__ */ (0, import_jsx_runtime153.jsx)("button", { type: "button", className: "truncate text-left font-medium hover:underline", onClick: () => onOpenRecord(row.id), children: shown3(title ? row[title.api_name] : row.id) || "Untitled" }) : /* @__PURE__ */ (0, import_jsx_runtime153.jsx)("span", { className: "truncate font-medium", children: shown3(title ? row[title.api_name] : row.id) || "Untitled" }),
|
|
@@ -47395,7 +47402,7 @@ function EntityChartBlock({ source, kind, by, measure, title, where, organizatio
|
|
|
47395
47402
|
};
|
|
47396
47403
|
}, [client, ask, kind, title]);
|
|
47397
47404
|
if (!block) {
|
|
47398
|
-
return /* @__PURE__ */ (0, import_jsx_runtime153.jsx)("div", { className: (0,
|
|
47405
|
+
return /* @__PURE__ */ (0, import_jsx_runtime153.jsx)("div", { className: (0, import_design_system139.cn)("min-h-24 animate-pulse rounded bg-muted/40", className), "aria-busy": "true" });
|
|
47399
47406
|
}
|
|
47400
47407
|
return /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(
|
|
47401
47408
|
ChartBlock,
|
|
@@ -47412,6 +47419,8 @@ function EntityChartBlock({ source, kind, by, measure, title, where, organizatio
|
|
|
47412
47419
|
function EntityTablePage({
|
|
47413
47420
|
source,
|
|
47414
47421
|
presentation = "page",
|
|
47422
|
+
searchOverride,
|
|
47423
|
+
onSearchChange,
|
|
47415
47424
|
pageSize = presentation === "embedded" ? EMBEDDED_PAGE_SIZE : 100,
|
|
47416
47425
|
layout: opened = "grid",
|
|
47417
47426
|
onLayoutChange,
|
|
@@ -47420,7 +47429,9 @@ function EntityTablePage({
|
|
|
47420
47429
|
actions,
|
|
47421
47430
|
className
|
|
47422
47431
|
}) {
|
|
47423
|
-
const
|
|
47432
|
+
const [typed2, setTyped] = (0, import_react267.useState)("");
|
|
47433
|
+
const term = searchOverride ?? typed2;
|
|
47434
|
+
const entity = useEntitySource(source.token, { limit: pageSize, search: term });
|
|
47424
47435
|
const [layout, setLayout] = (0, import_react267.useState)(opened);
|
|
47425
47436
|
(0, import_react267.useEffect)(() => setLayout(opened), [opened]);
|
|
47426
47437
|
const choose = (next) => {
|
|
@@ -47452,21 +47463,21 @@ function EntityTablePage({
|
|
|
47452
47463
|
rowNoun: (entity.label ?? "record").toLowerCase(),
|
|
47453
47464
|
enabled: layout === "grid"
|
|
47454
47465
|
});
|
|
47455
|
-
return /* @__PURE__ */ (0, import_jsx_runtime153.jsxs)("div", { className: (0,
|
|
47466
|
+
return /* @__PURE__ */ (0, import_jsx_runtime153.jsxs)("div", { className: (0, import_design_system139.cn)("flex min-w-0 flex-col gap-2", className), "data-records-entity-page": source.token, children: [
|
|
47456
47467
|
presentation === "page" || boardable || entity.creatable ? /* @__PURE__ */ (0, import_jsx_runtime153.jsxs)("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
47457
47468
|
presentation === "page" ? /* @__PURE__ */ (0, import_jsx_runtime153.jsx)("h2", { className: "truncate text-base font-semibold", children: entity.label ?? (entity.loading ? "Loading\u2026" : "Table") }) : null,
|
|
47458
47469
|
presentation === "page" ? /* @__PURE__ */ (0, import_jsx_runtime153.jsx)("span", { className: "text-xs tabular-nums text-muted-foreground", children: entity.loading ? "" : entity.total.toLocaleString() }) : null,
|
|
47459
47470
|
/* @__PURE__ */ (0, import_jsx_runtime153.jsxs)("span", { className: "ml-auto flex items-center gap-1", children: [
|
|
47460
47471
|
boardable ? /* @__PURE__ */ (0, import_jsx_runtime153.jsxs)(import_jsx_runtime153.Fragment, { children: [
|
|
47461
|
-
/* @__PURE__ */ (0, import_jsx_runtime153.jsx)(
|
|
47462
|
-
/* @__PURE__ */ (0, import_jsx_runtime153.jsx)(
|
|
47472
|
+
/* @__PURE__ */ (0, import_jsx_runtime153.jsx)(import_design_system139.Button, { size: "sm", variant: layout === "grid" ? "secondary" : "ghost", "aria-pressed": layout === "grid", onClick: () => choose("grid"), children: "Table" }),
|
|
47473
|
+
/* @__PURE__ */ (0, import_jsx_runtime153.jsx)(import_design_system139.Button, { size: "sm", variant: layout === "board" ? "secondary" : "ghost", "aria-pressed": layout === "board", onClick: () => choose("board"), children: "Board" })
|
|
47463
47474
|
] }) : null,
|
|
47464
|
-
entity.creatable && naming === null ? /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(
|
|
47475
|
+
entity.creatable && naming === null ? /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(import_design_system139.Button, { size: "sm", variant: "ghost", onClick: () => {
|
|
47465
47476
|
setAddRefused(null);
|
|
47466
47477
|
setNaming("");
|
|
47467
47478
|
}, children: "New page" }) : null,
|
|
47468
47479
|
entity.creatable && naming !== null ? /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(
|
|
47469
|
-
|
|
47480
|
+
import_design_system139.Input,
|
|
47470
47481
|
{
|
|
47471
47482
|
autoFocus: true,
|
|
47472
47483
|
"data-records-entity-new": source.token,
|
|
@@ -47495,8 +47506,19 @@ function EntityTablePage({
|
|
|
47495
47506
|
actions
|
|
47496
47507
|
] })
|
|
47497
47508
|
] }) : null,
|
|
47498
|
-
addRefused ? /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(
|
|
47509
|
+
addRefused ? /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(import_design_system139.ErrorBox, { className: "rounded border border-destructive/40 px-1.5 py-1 text-xs text-destructive", message: addRefused, operation: "Add a row", origin: "records-ui/entityViews" }) : null,
|
|
47499
47510
|
entity.error ? /* @__PURE__ */ (0, import_jsx_runtime153.jsx)("p", { className: "px-1 py-3 text-xs text-muted-foreground", children: `This table could not be read: ${entity.error}` }) : layout === "board" && boardable ? /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(EntityBoard, { entity, groupBy, onOpenRecord }) : /* @__PURE__ */ (0, import_jsx_runtime153.jsxs)(import_jsx_runtime153.Fragment, { children: [
|
|
47511
|
+
presentation === "embedded" ? /* @__PURE__ */ (0, import_jsx_runtime153.jsx)("div", { className: "flex min-w-0 items-center justify-end", "data-records-entity-search": "", children: /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(import_design_system138.TooltipProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(
|
|
47512
|
+
import_design_system138.TapTargetSearchGroup,
|
|
47513
|
+
{
|
|
47514
|
+
placeholder: "Search",
|
|
47515
|
+
value: term,
|
|
47516
|
+
onValueChange: (next) => {
|
|
47517
|
+
setTyped(next);
|
|
47518
|
+
onSearchChange?.(next);
|
|
47519
|
+
}
|
|
47520
|
+
}
|
|
47521
|
+
) }) }) : null,
|
|
47500
47522
|
/* @__PURE__ */ (0, import_jsx_runtime153.jsx)(EntityGrid, { entity, pageSize, embedded: presentation === "embedded", ...drill ? { drill } : {} }),
|
|
47501
47523
|
presentation === "embedded" && entity.hasMore ? /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(
|
|
47502
47524
|
import_data_table22.MatrxTableCardShowMore,
|
|
@@ -47523,6 +47545,8 @@ function TablePage2(props) {
|
|
|
47523
47545
|
source,
|
|
47524
47546
|
...rest.presentation ? { presentation: rest.presentation } : {},
|
|
47525
47547
|
...rest.pageSize ? { pageSize: rest.pageSize } : {},
|
|
47548
|
+
...rest.searchOverride !== void 0 ? { searchOverride: rest.searchOverride } : {},
|
|
47549
|
+
...rest.onSearchChange ? { onSearchChange: rest.onSearchChange } : {},
|
|
47526
47550
|
...layout ? { layout } : {},
|
|
47527
47551
|
...onLayoutChange ? { onLayoutChange } : {},
|
|
47528
47552
|
...groupBy ? { groupBy } : {},
|
|
@@ -47536,7 +47560,7 @@ function TablePage2(props) {
|
|
|
47536
47560
|
var import_react269 = require("react");
|
|
47537
47561
|
var import_records62 = require("@ai-matrx/records");
|
|
47538
47562
|
var import_react270 = require("@ai-matrx/records/react");
|
|
47539
|
-
var
|
|
47563
|
+
var import_design_system140 = require("@ai-matrx/design-system");
|
|
47540
47564
|
var import_jsx_runtime155 = require("react/jsx-runtime");
|
|
47541
47565
|
var DATA_BINDING_SHAPES = [
|
|
47542
47566
|
{ value: "collection", label: "The whole table" },
|
|
@@ -47672,7 +47696,7 @@ function BindingDetails({
|
|
|
47672
47696
|
const setTemplate = (next) => onChange({ ...binding, transform: { join: "\n", ...binding.transform, name: "list", template: next } });
|
|
47673
47697
|
return /* @__PURE__ */ (0, import_jsx_runtime155.jsxs)("div", { className: "flex flex-col gap-2", children: [
|
|
47674
47698
|
/* @__PURE__ */ (0, import_jsx_runtime155.jsx)("div", { className: "flex flex-wrap gap-1", role: "radiogroup", "aria-label": "What to read", children: DATA_BINDING_SHAPES.map((s) => /* @__PURE__ */ (0, import_jsx_runtime155.jsx)(
|
|
47675
|
-
|
|
47699
|
+
import_design_system140.Button,
|
|
47676
47700
|
{
|
|
47677
47701
|
type: "button",
|
|
47678
47702
|
size: "sm",
|
|
@@ -47695,7 +47719,7 @@ function BindingDetails({
|
|
|
47695
47719
|
}
|
|
47696
47720
|
),
|
|
47697
47721
|
shape === "value" && /* @__PURE__ */ (0, import_jsx_runtime155.jsx)(
|
|
47698
|
-
|
|
47722
|
+
import_design_system140.CreatablePicker,
|
|
47699
47723
|
{
|
|
47700
47724
|
value: binding.field_key ?? null,
|
|
47701
47725
|
options: fieldOptions,
|
|
@@ -47712,7 +47736,7 @@ function BindingDetails({
|
|
|
47712
47736
|
/* @__PURE__ */ (0, import_jsx_runtime155.jsx)(
|
|
47713
47737
|
"textarea",
|
|
47714
47738
|
{
|
|
47715
|
-
className: (0,
|
|
47739
|
+
className: (0, import_design_system140.cn)(
|
|
47716
47740
|
"min-h-[3.5rem] w-full rounded-md border border-border bg-background px-2 py-1.5 font-mono text-xs"
|
|
47717
47741
|
),
|
|
47718
47742
|
"aria-label": "Each row reads as",
|
|
@@ -47722,7 +47746,7 @@ function BindingDetails({
|
|
|
47722
47746
|
}
|
|
47723
47747
|
),
|
|
47724
47748
|
!disabled && /* @__PURE__ */ (0, import_jsx_runtime155.jsx)("div", { className: "flex flex-wrap gap-1", children: fieldList.flatMap(bindingPlaceholdersFor).map((p) => /* @__PURE__ */ (0, import_jsx_runtime155.jsx)(
|
|
47725
|
-
|
|
47749
|
+
import_design_system140.Button,
|
|
47726
47750
|
{
|
|
47727
47751
|
type: "button",
|
|
47728
47752
|
size: "sm",
|
|
@@ -47737,7 +47761,7 @@ function BindingDetails({
|
|
|
47737
47761
|
shape === "collection" && /* @__PURE__ */ (0, import_jsx_runtime155.jsxs)("label", { className: "flex items-center gap-2 text-xs text-muted-foreground", children: [
|
|
47738
47762
|
"Up to",
|
|
47739
47763
|
/* @__PURE__ */ (0, import_jsx_runtime155.jsx)(
|
|
47740
|
-
|
|
47764
|
+
import_design_system140.BasicInput,
|
|
47741
47765
|
{
|
|
47742
47766
|
type: "number",
|
|
47743
47767
|
min: 1,
|
|
@@ -47756,7 +47780,7 @@ function BindingDetails({
|
|
|
47756
47780
|
/* @__PURE__ */ (0, import_jsx_runtime155.jsxs)("div", { className: "flex flex-wrap items-center gap-1", role: "radiogroup", "aria-label": "If nothing is found", children: [
|
|
47757
47781
|
/* @__PURE__ */ (0, import_jsx_runtime155.jsx)("span", { className: "text-xs text-muted-foreground", children: "If nothing is found" }),
|
|
47758
47782
|
DATA_BINDING_MISSING.map((m) => /* @__PURE__ */ (0, import_jsx_runtime155.jsx)(
|
|
47759
|
-
|
|
47783
|
+
import_design_system140.Button,
|
|
47760
47784
|
{
|
|
47761
47785
|
type: "button",
|
|
47762
47786
|
size: "sm",
|
|
@@ -47853,7 +47877,7 @@ function RecordNameWords({ tableId, recordId }) {
|
|
|
47853
47877
|
// src/HeldChangeDecision.tsx
|
|
47854
47878
|
var import_react272 = require("react");
|
|
47855
47879
|
var import_react273 = require("@ai-matrx/records/react");
|
|
47856
|
-
var
|
|
47880
|
+
var import_design_system141 = require("@ai-matrx/design-system");
|
|
47857
47881
|
var import_jsx_runtime157 = require("react/jsx-runtime");
|
|
47858
47882
|
function HeldChangeDecision({ dataSource, userId, organizationId, approvalId, onDecided }) {
|
|
47859
47883
|
return /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(import_react273.RecordsProvider, { config: { dataSource, actor: personActor(userId), organizationId }, children: /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(Decision, { approvalId, onDecided }) });
|
|
@@ -47888,8 +47912,8 @@ function Decision({ approvalId, onDecided }) {
|
|
|
47888
47912
|
if (may === null) return /* @__PURE__ */ (0, import_jsx_runtime157.jsx)("p", { className: "text-xs text-muted-foreground", children: "Checking who can decide\u2026" });
|
|
47889
47913
|
return /* @__PURE__ */ (0, import_jsx_runtime157.jsxs)("div", { className: "flex flex-col gap-1.5", children: [
|
|
47890
47914
|
may ? /* @__PURE__ */ (0, import_jsx_runtime157.jsxs)("div", { className: "flex gap-2", children: [
|
|
47891
|
-
/* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
|
|
47892
|
-
/* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
|
|
47915
|
+
/* @__PURE__ */ (0, import_jsx_runtime157.jsx)(import_design_system141.Button, { type: "button", size: "sm", disabled: busy !== null, onClick: () => void decide(true), children: busy === "approve" ? "Approving\u2026" : "Approve" }),
|
|
47916
|
+
/* @__PURE__ */ (0, import_jsx_runtime157.jsx)(import_design_system141.Button, { type: "button", size: "sm", variant: "outline", disabled: busy !== null, onClick: () => void decide(false), children: busy === "refuse" ? "Refusing\u2026" : "Refuse" })
|
|
47893
47917
|
] }) : !error && /* @__PURE__ */ (0, import_jsx_runtime157.jsx)("p", { className: "text-xs text-muted-foreground", children: "An owner or admin of this organization decides this." }),
|
|
47894
47918
|
error ? /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(RefusalLine, { error }) : null
|
|
47895
47919
|
] });
|