@burdenoff/microfe-labsofscience 2026.827.1 → 2026.829.1
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/dist/labsofscience/LabsOfScienceRoot.d.ts.map +1 -1
- package/dist/labsofscience/LabsOfScienceRoot.js +54 -57
- package/dist/labsofscience/LabsOfScienceRoot.js.map +1 -1
- package/dist/labsofscience/components/BottomNav.d.ts.map +1 -1
- package/dist/labsofscience/components/BottomNav.js +67 -63
- package/dist/labsofscience/components/BottomNav.js.map +1 -1
- package/dist/labsofscience/hooks/index.d.ts +1 -0
- package/dist/labsofscience/hooks/index.d.ts.map +1 -1
- package/dist/labsofscience/hooks/useTr.d.ts +17 -0
- package/dist/labsofscience/hooks/useTr.d.ts.map +1 -0
- package/dist/labsofscience/hooks/useTr.js +14 -0
- package/dist/labsofscience/hooks/useTr.js.map +1 -0
- package/dist/labsofscience/pages/OverviewPage.d.ts.map +1 -1
- package/dist/labsofscience/pages/OverviewPage.js +187 -161
- package/dist/labsofscience/pages/OverviewPage.js.map +1 -1
- package/dist/labsofscience/pages/datasets/DatasetsListPage.d.ts.map +1 -1
- package/dist/labsofscience/pages/datasets/DatasetsListPage.js +129 -128
- package/dist/labsofscience/pages/datasets/DatasetsListPage.js.map +1 -1
- package/dist/labsofscience/pages/experiments/ExperimentsListPage.d.ts.map +1 -1
- package/dist/labsofscience/pages/experiments/ExperimentsListPage.js +148 -147
- package/dist/labsofscience/pages/experiments/ExperimentsListPage.js.map +1 -1
- package/dist/labsofscience/pages/instruments/InstrumentsListPage.d.ts.map +1 -1
- package/dist/labsofscience/pages/instruments/InstrumentsListPage.js +140 -139
- package/dist/labsofscience/pages/instruments/InstrumentsListPage.js.map +1 -1
- package/dist/labsofscience/pages/inventory/InventoryListPage.d.ts.map +1 -1
- package/dist/labsofscience/pages/inventory/InventoryListPage.js +169 -168
- package/dist/labsofscience/pages/inventory/InventoryListPage.js.map +1 -1
- package/dist/labsofscience/pages/notebook/NotebookListPage.d.ts.map +1 -1
- package/dist/labsofscience/pages/notebook/NotebookListPage.js +123 -122
- package/dist/labsofscience/pages/notebook/NotebookListPage.js.map +1 -1
- package/dist/labsofscience/pages/projects/ProjectsListPage.d.ts.map +1 -1
- package/dist/labsofscience/pages/projects/ProjectsListPage.js +141 -140
- package/dist/labsofscience/pages/projects/ProjectsListPage.js.map +1 -1
- package/dist/labsofscience/pages/protocols/ProtocolsListPage.d.ts.map +1 -1
- package/dist/labsofscience/pages/protocols/ProtocolsListPage.js +123 -122
- package/dist/labsofscience/pages/protocols/ProtocolsListPage.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,151 +1,152 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
1
|
+
import { useTr as e } from "../../hooks/useTr.js";
|
|
2
|
+
import { useLabsOfScience as t } from "../../context/LabsOfScienceContext.js";
|
|
3
|
+
import { PageLayout as n } from "../../components/PageLayout.js";
|
|
4
|
+
import { StatusBadge as r } from "../../components/StatusBadge.js";
|
|
5
|
+
import { QueryBoundary as i } from "../../components/QueryStates.js";
|
|
6
|
+
import { useProtocols as a } from "../../hooks/useLabsOfScienceApi.js";
|
|
7
|
+
import { formatDateShort as o, formatDuration as s, titleCase as c } from "../../utils/formatters.js";
|
|
8
|
+
import { EmptyState as l } from "../../components/EmptyState.js";
|
|
9
|
+
import { ListSearchInput as u } from "../../components/ListSearchInput.js";
|
|
10
|
+
import { useDebouncedValue as d } from "../../utils/useDebouncedValue.js";
|
|
11
|
+
import { ProtocolFormDialog as f } from "./ProtocolFormDialog.js";
|
|
12
|
+
import { useState as p } from "react";
|
|
13
|
+
import { Microscope as m, Plus as h } from "lucide-react";
|
|
14
|
+
import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
|
|
15
|
+
import { Button as y, Pagination as b, ResponsiveTable as x, Select as S, SelectContent as C, SelectItem as w, SelectTrigger as T, SelectValue as E } from "@burdenoff/fe-libs/ui";
|
|
15
16
|
//#region src/labsofscience/pages/protocols/ProtocolsListPage.tsx
|
|
16
|
-
var
|
|
17
|
+
var D = 20, O = [
|
|
17
18
|
"DRAFT",
|
|
18
19
|
"PUBLISHED",
|
|
19
20
|
"DEPRECATED"
|
|
20
21
|
];
|
|
21
|
-
function
|
|
22
|
-
let { navigateTo:
|
|
23
|
-
status:
|
|
24
|
-
search:
|
|
22
|
+
function k() {
|
|
23
|
+
let { navigateTo: k } = t(), A = e(), [j, M] = p(1), [N, P] = p("ALL"), [F, I] = p(""), [L, R] = p(!1), z = d(F.trim()), B = a({
|
|
24
|
+
status: N === "ALL" ? void 0 : N,
|
|
25
|
+
search: z || void 0,
|
|
25
26
|
pagination: {
|
|
26
|
-
limit:
|
|
27
|
-
offset: (
|
|
27
|
+
limit: D,
|
|
28
|
+
offset: (j - 1) * D
|
|
28
29
|
}
|
|
29
|
-
}),
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
30
|
+
}), V = B.data?.items ?? [], H = B.data?.pageInfo.hasMore ?? !1, U = [
|
|
31
|
+
{
|
|
32
|
+
key: "name",
|
|
33
|
+
header: A("labsofscience.protocols.column.protocol", "Protocol"),
|
|
34
|
+
priority: "primary",
|
|
35
|
+
cell: (e) => /* @__PURE__ */ v("div", {
|
|
36
|
+
className: "min-w-0",
|
|
37
|
+
children: [/* @__PURE__ */ _("p", {
|
|
38
|
+
className: "truncate font-medium text-text-primary",
|
|
39
|
+
children: e.name
|
|
40
|
+
}), e.summary && /* @__PURE__ */ _("p", {
|
|
41
|
+
className: "truncate text-xs text-text-tertiary",
|
|
42
|
+
children: e.summary
|
|
43
|
+
})]
|
|
44
|
+
})
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
key: "version",
|
|
48
|
+
header: A("labsofscience.protocols.column.version", "Version"),
|
|
49
|
+
cell: (e) => /* @__PURE__ */ v("span", {
|
|
50
|
+
className: "tabular-nums text-text-secondary",
|
|
51
|
+
children: ["v", e.version]
|
|
52
|
+
})
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
key: "status",
|
|
56
|
+
header: A("labsofscience.protocols.column.status", "Status"),
|
|
57
|
+
priority: "primary",
|
|
58
|
+
cell: (e) => /* @__PURE__ */ _(r, { status: e.status })
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
key: "estimatedMinutes",
|
|
62
|
+
header: A("labsofscience.protocols.column.estimatedTime", "Est. time"),
|
|
63
|
+
priority: "hidden-on-mobile",
|
|
64
|
+
cell: (e) => /* @__PURE__ */ _("span", {
|
|
65
|
+
className: "text-text-secondary",
|
|
66
|
+
children: s(e.estimatedMinutes)
|
|
67
|
+
})
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
key: "updatedAt",
|
|
71
|
+
header: A("labsofscience.protocols.column.updated", "Updated"),
|
|
72
|
+
priority: "hidden-on-mobile",
|
|
73
|
+
cell: (e) => /* @__PURE__ */ _("span", {
|
|
74
|
+
className: "text-text-secondary",
|
|
75
|
+
children: o(e.updatedAt)
|
|
76
|
+
})
|
|
77
|
+
}
|
|
78
|
+
];
|
|
79
|
+
return /* @__PURE__ */ v(n, {
|
|
80
|
+
title: A("labsofscience.protocols.title", "Protocols"),
|
|
81
|
+
description: A("labsofscience.protocols.description", "Versioned, reusable methods frozen at publish time."),
|
|
82
|
+
actions: /* @__PURE__ */ v(y, {
|
|
83
|
+
onClick: () => R(!0),
|
|
84
|
+
children: [/* @__PURE__ */ _(h, { className: "mr-2 h-4 w-4" }), A("labsofscience.protocols.newButton", "New protocol")]
|
|
36
85
|
}),
|
|
37
|
-
children: [/* @__PURE__ */
|
|
86
|
+
children: [/* @__PURE__ */ v("div", {
|
|
38
87
|
className: "space-y-4",
|
|
39
|
-
children: [/* @__PURE__ */
|
|
88
|
+
children: [/* @__PURE__ */ v("div", {
|
|
40
89
|
className: "flex flex-wrap items-center gap-3",
|
|
41
|
-
children: [/* @__PURE__ */
|
|
42
|
-
value:
|
|
43
|
-
ariaLabel: "Search protocols",
|
|
44
|
-
placeholder: "Search protocols…",
|
|
90
|
+
children: [/* @__PURE__ */ _(u, {
|
|
91
|
+
value: F,
|
|
92
|
+
ariaLabel: A("labsofscience.protocols.searchAria", "Search protocols"),
|
|
93
|
+
placeholder: A("labsofscience.protocols.searchPlaceholder", "Search protocols…"),
|
|
45
94
|
onChange: (e) => {
|
|
46
|
-
|
|
95
|
+
I(e), M(1);
|
|
47
96
|
}
|
|
48
|
-
}), /* @__PURE__ */
|
|
49
|
-
value:
|
|
97
|
+
}), /* @__PURE__ */ v(S, {
|
|
98
|
+
value: N,
|
|
50
99
|
onValueChange: (e) => {
|
|
51
|
-
|
|
100
|
+
P(e), M(1);
|
|
52
101
|
},
|
|
53
|
-
children: [/* @__PURE__ */
|
|
102
|
+
children: [/* @__PURE__ */ _(T, {
|
|
54
103
|
className: "w-full sm:w-48",
|
|
55
|
-
"aria-label": "Filter by status",
|
|
56
|
-
children: /* @__PURE__ */
|
|
57
|
-
}), /* @__PURE__ */
|
|
104
|
+
"aria-label": A("labsofscience.protocols.statusFilterAria", "Filter by status"),
|
|
105
|
+
children: /* @__PURE__ */ _(E, { placeholder: A("labsofscience.protocols.allStatuses", "All statuses") })
|
|
106
|
+
}), /* @__PURE__ */ v(C, { children: [/* @__PURE__ */ _(w, {
|
|
58
107
|
value: "ALL",
|
|
59
|
-
children: "All statuses"
|
|
60
|
-
}),
|
|
108
|
+
children: A("labsofscience.protocols.allStatuses", "All statuses")
|
|
109
|
+
}), O.map((e) => /* @__PURE__ */ _(w, {
|
|
61
110
|
value: e,
|
|
62
|
-
children:
|
|
111
|
+
children: c(e)
|
|
63
112
|
}, e))] })]
|
|
64
113
|
})]
|
|
65
|
-
}), /* @__PURE__ */
|
|
66
|
-
isLoading:
|
|
67
|
-
isError:
|
|
68
|
-
error:
|
|
69
|
-
onRetry: () => void
|
|
70
|
-
loadingLabel: "Loading protocols…",
|
|
71
|
-
children:
|
|
72
|
-
icon: /* @__PURE__ */
|
|
73
|
-
title: "No protocols found",
|
|
74
|
-
description: "Capture a reusable method as a versioned protocol.",
|
|
75
|
-
action: /* @__PURE__ */
|
|
76
|
-
onClick: () =>
|
|
77
|
-
children: [/* @__PURE__ */
|
|
114
|
+
}), /* @__PURE__ */ _(i, {
|
|
115
|
+
isLoading: B.isLoading,
|
|
116
|
+
isError: B.isError,
|
|
117
|
+
error: B.error,
|
|
118
|
+
onRetry: () => void B.refetch(),
|
|
119
|
+
loadingLabel: A("labsofscience.protocols.loading", "Loading protocols…"),
|
|
120
|
+
children: V.length === 0 ? /* @__PURE__ */ _(l, {
|
|
121
|
+
icon: /* @__PURE__ */ _(m, { className: "h-10 w-10" }),
|
|
122
|
+
title: A("labsofscience.protocols.emptyTitle", "No protocols found"),
|
|
123
|
+
description: A("labsofscience.protocols.emptyDescription", "Capture a reusable method as a versioned protocol."),
|
|
124
|
+
action: /* @__PURE__ */ v(y, {
|
|
125
|
+
onClick: () => R(!0),
|
|
126
|
+
children: [/* @__PURE__ */ _(h, { className: "mr-2 h-4 w-4" }), A("labsofscience.protocols.newButton", "New protocol")]
|
|
78
127
|
})
|
|
79
|
-
}) : /* @__PURE__ */
|
|
80
|
-
columns:
|
|
81
|
-
|
|
82
|
-
key: "name",
|
|
83
|
-
header: "Protocol",
|
|
84
|
-
priority: "primary",
|
|
85
|
-
cell: (e) => /* @__PURE__ */ _("div", {
|
|
86
|
-
className: "min-w-0",
|
|
87
|
-
children: [/* @__PURE__ */ g("p", {
|
|
88
|
-
className: "truncate font-medium text-text-primary",
|
|
89
|
-
children: e.name
|
|
90
|
-
}), e.summary && /* @__PURE__ */ g("p", {
|
|
91
|
-
className: "truncate text-xs text-text-tertiary",
|
|
92
|
-
children: e.summary
|
|
93
|
-
})]
|
|
94
|
-
})
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
key: "version",
|
|
98
|
-
header: "Version",
|
|
99
|
-
cell: (e) => /* @__PURE__ */ _("span", {
|
|
100
|
-
className: "tabular-nums text-text-secondary",
|
|
101
|
-
children: ["v", e.version]
|
|
102
|
-
})
|
|
103
|
-
},
|
|
104
|
-
{
|
|
105
|
-
key: "status",
|
|
106
|
-
header: "Status",
|
|
107
|
-
priority: "primary",
|
|
108
|
-
cell: (e) => /* @__PURE__ */ g(n, { status: e.status })
|
|
109
|
-
},
|
|
110
|
-
{
|
|
111
|
-
key: "estimatedMinutes",
|
|
112
|
-
header: "Est. time",
|
|
113
|
-
priority: "hidden-on-mobile",
|
|
114
|
-
cell: (e) => /* @__PURE__ */ g("span", {
|
|
115
|
-
className: "text-text-secondary",
|
|
116
|
-
children: o(e.estimatedMinutes)
|
|
117
|
-
})
|
|
118
|
-
},
|
|
119
|
-
{
|
|
120
|
-
key: "updatedAt",
|
|
121
|
-
header: "Updated",
|
|
122
|
-
priority: "hidden-on-mobile",
|
|
123
|
-
cell: (e) => /* @__PURE__ */ g("span", {
|
|
124
|
-
className: "text-text-secondary",
|
|
125
|
-
children: a(e.updatedAt)
|
|
126
|
-
})
|
|
127
|
-
}
|
|
128
|
-
],
|
|
129
|
-
data: z,
|
|
128
|
+
}) : /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _(x, {
|
|
129
|
+
columns: U,
|
|
130
|
+
data: V,
|
|
130
131
|
rowKey: (e) => e.id,
|
|
131
|
-
onRowClick: (e) =>
|
|
132
|
-
}), /* @__PURE__ */
|
|
133
|
-
page:
|
|
134
|
-
pageSize:
|
|
135
|
-
hasNextPage:
|
|
136
|
-
hasPreviousPage:
|
|
137
|
-
loading:
|
|
138
|
-
onPageChange:
|
|
132
|
+
onRowClick: (e) => k(`protocols/${e.id}`)
|
|
133
|
+
}), /* @__PURE__ */ _(b, {
|
|
134
|
+
page: j,
|
|
135
|
+
pageSize: D,
|
|
136
|
+
hasNextPage: H,
|
|
137
|
+
hasPreviousPage: j > 1,
|
|
138
|
+
loading: B.isFetching,
|
|
139
|
+
onPageChange: M
|
|
139
140
|
})] })
|
|
140
141
|
})]
|
|
141
|
-
}), /* @__PURE__ */
|
|
142
|
-
open:
|
|
143
|
-
onOpenChange:
|
|
144
|
-
onSaved: (e) =>
|
|
142
|
+
}), /* @__PURE__ */ _(f, {
|
|
143
|
+
open: L,
|
|
144
|
+
onOpenChange: R,
|
|
145
|
+
onSaved: (e) => k(`protocols/${e.id}`)
|
|
145
146
|
})]
|
|
146
147
|
});
|
|
147
148
|
}
|
|
148
149
|
//#endregion
|
|
149
|
-
export {
|
|
150
|
+
export { k as ProtocolsListPage };
|
|
150
151
|
|
|
151
152
|
//# sourceMappingURL=ProtocolsListPage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProtocolsListPage.js","names":[],"sources":["../../../../src/labsofscience/pages/protocols/ProtocolsListPage.tsx"],"sourcesContent":["/**\n * Protocols list page\n * @module labsofscience/pages/protocols\n */\n\nimport { useState } from 'react';\nimport { Microscope, Plus } from 'lucide-react';\nimport {\n Button,\n Pagination,\n ResponsiveTable,\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n type ResponsiveTableColumn,\n} from '@burdenoff/fe-libs/ui';\nimport { PageLayout } from '../../components/PageLayout';\nimport { StatusBadge } from '../../components/StatusBadge';\nimport { EmptyState } from '../../components/EmptyState';\nimport { QueryBoundary } from '../../components/QueryStates';\nimport { ListSearchInput } from '../../components/ListSearchInput';\nimport { useLabsOfScience } from '../../context/LabsOfScienceContext';\nimport { useProtocols } from '../../hooks/useLabsOfScienceApi';\nimport type { LabProtocol, LabProtocolStatus } from '../../types';\nimport { formatDateShort, formatDuration, titleCase } from '../../utils/formatters';\nimport { useDebouncedValue } from '../../utils/useDebouncedValue';\nimport { ProtocolFormDialog } from './ProtocolFormDialog';\n\nconst PAGE_SIZE = 20;\nconst STATUS_OPTIONS: LabProtocolStatus[] = ['DRAFT', 'PUBLISHED', 'DEPRECATED'];\n\nexport function ProtocolsListPage() {\n const { navigateTo } = useLabsOfScience();\n const [page, setPage] = useState(1);\n const [status, setStatus] = useState<LabProtocolStatus | 'ALL'>('ALL');\n const [search, setSearch] = useState('');\n const [createOpen, setCreateOpen] = useState(false);\n const debouncedSearch = useDebouncedValue(search.trim());\n\n const query = useProtocols({\n status: status === 'ALL' ? undefined : status,\n search: debouncedSearch || undefined,\n pagination: { limit: PAGE_SIZE, offset: (page - 1) * PAGE_SIZE },\n });\n\n const items = query.data?.items ?? [];\n const hasMore = query.data?.pageInfo.hasMore ?? false;\n\n const columns: ResponsiveTableColumn<LabProtocol>[] = [\n {\n key: 'name',\n header: 'Protocol',\n priority: 'primary',\n cell: (row) => (\n <div className=\"min-w-0\">\n <p className=\"truncate font-medium text-text-primary\">{row.name}</p>\n {row.summary && <p className=\"truncate text-xs text-text-tertiary\">{row.summary}</p>}\n </div>\n ),\n },\n {\n key: 'version',\n header: 'Version',\n cell: (row) => <span className=\"tabular-nums text-text-secondary\">v{row.version}</span>,\n },\n {\n key: 'status',\n header: 'Status',\n priority: 'primary',\n cell: (row) => <StatusBadge status={row.status} />,\n },\n {\n key: 'estimatedMinutes',\n header: 'Est. time',\n priority: 'hidden-on-mobile',\n cell: (row) => (\n <span className=\"text-text-secondary\">{formatDuration(row.estimatedMinutes)}</span>\n ),\n },\n {\n key: 'updatedAt',\n header: 'Updated',\n priority: 'hidden-on-mobile',\n cell: (row) => <span className=\"text-text-secondary\">{formatDateShort(row.updatedAt)}</span>,\n },\n ];\n\n return (\n <PageLayout\n title
|
|
1
|
+
{"version":3,"file":"ProtocolsListPage.js","names":[],"sources":["../../../../src/labsofscience/pages/protocols/ProtocolsListPage.tsx"],"sourcesContent":["/**\n * Protocols list page\n * @module labsofscience/pages/protocols\n */\n\nimport { useState } from 'react';\nimport { Microscope, Plus } from 'lucide-react';\nimport {\n Button,\n Pagination,\n ResponsiveTable,\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n type ResponsiveTableColumn,\n} from '@burdenoff/fe-libs/ui';\nimport { PageLayout } from '../../components/PageLayout';\nimport { StatusBadge } from '../../components/StatusBadge';\nimport { EmptyState } from '../../components/EmptyState';\nimport { QueryBoundary } from '../../components/QueryStates';\nimport { ListSearchInput } from '../../components/ListSearchInput';\nimport { useLabsOfScience } from '../../context/LabsOfScienceContext';\nimport { useProtocols } from '../../hooks/useLabsOfScienceApi';\nimport { useTr } from '../../hooks/useTr';\nimport type { LabProtocol, LabProtocolStatus } from '../../types';\nimport { formatDateShort, formatDuration, titleCase } from '../../utils/formatters';\nimport { useDebouncedValue } from '../../utils/useDebouncedValue';\nimport { ProtocolFormDialog } from './ProtocolFormDialog';\n\nconst PAGE_SIZE = 20;\nconst STATUS_OPTIONS: LabProtocolStatus[] = ['DRAFT', 'PUBLISHED', 'DEPRECATED'];\n\nexport function ProtocolsListPage() {\n const { navigateTo } = useLabsOfScience();\n const tr = useTr();\n const [page, setPage] = useState(1);\n const [status, setStatus] = useState<LabProtocolStatus | 'ALL'>('ALL');\n const [search, setSearch] = useState('');\n const [createOpen, setCreateOpen] = useState(false);\n const debouncedSearch = useDebouncedValue(search.trim());\n\n const query = useProtocols({\n status: status === 'ALL' ? undefined : status,\n search: debouncedSearch || undefined,\n pagination: { limit: PAGE_SIZE, offset: (page - 1) * PAGE_SIZE },\n });\n\n const items = query.data?.items ?? [];\n const hasMore = query.data?.pageInfo.hasMore ?? false;\n\n const columns: ResponsiveTableColumn<LabProtocol>[] = [\n {\n key: 'name',\n header: tr('labsofscience.protocols.column.protocol', 'Protocol'),\n priority: 'primary',\n cell: (row) => (\n <div className=\"min-w-0\">\n <p className=\"truncate font-medium text-text-primary\">{row.name}</p>\n {row.summary && <p className=\"truncate text-xs text-text-tertiary\">{row.summary}</p>}\n </div>\n ),\n },\n {\n key: 'version',\n header: tr('labsofscience.protocols.column.version', 'Version'),\n cell: (row) => <span className=\"tabular-nums text-text-secondary\">v{row.version}</span>,\n },\n {\n key: 'status',\n header: tr('labsofscience.protocols.column.status', 'Status'),\n priority: 'primary',\n cell: (row) => <StatusBadge status={row.status} />,\n },\n {\n key: 'estimatedMinutes',\n header: tr('labsofscience.protocols.column.estimatedTime', 'Est. time'),\n priority: 'hidden-on-mobile',\n cell: (row) => (\n <span className=\"text-text-secondary\">{formatDuration(row.estimatedMinutes)}</span>\n ),\n },\n {\n key: 'updatedAt',\n header: tr('labsofscience.protocols.column.updated', 'Updated'),\n priority: 'hidden-on-mobile',\n cell: (row) => <span className=\"text-text-secondary\">{formatDateShort(row.updatedAt)}</span>,\n },\n ];\n\n return (\n <PageLayout\n title={tr('labsofscience.protocols.title', 'Protocols')}\n description={tr(\n 'labsofscience.protocols.description',\n 'Versioned, reusable methods frozen at publish time.'\n )}\n actions={\n <Button onClick={() => setCreateOpen(true)}>\n <Plus className=\"mr-2 h-4 w-4\" />\n {tr('labsofscience.protocols.newButton', 'New protocol')}\n </Button>\n }\n >\n <div className=\"space-y-4\">\n <div className=\"flex flex-wrap items-center gap-3\">\n <ListSearchInput\n value={search}\n ariaLabel={tr('labsofscience.protocols.searchAria', 'Search protocols')}\n placeholder={tr('labsofscience.protocols.searchPlaceholder', 'Search protocols…')}\n onChange={(value) => {\n setSearch(value);\n setPage(1);\n }}\n />\n <Select\n value={status}\n onValueChange={(value) => {\n setStatus(value as LabProtocolStatus | 'ALL');\n setPage(1);\n }}\n >\n <SelectTrigger\n className=\"w-full sm:w-48\"\n aria-label={tr('labsofscience.protocols.statusFilterAria', 'Filter by status')}\n >\n <SelectValue\n placeholder={tr('labsofscience.protocols.allStatuses', 'All statuses')}\n />\n </SelectTrigger>\n <SelectContent>\n <SelectItem value=\"ALL\">\n {tr('labsofscience.protocols.allStatuses', 'All statuses')}\n </SelectItem>\n {STATUS_OPTIONS.map((option) => (\n <SelectItem key={option} value={option}>\n {titleCase(option)}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </div>\n\n <QueryBoundary\n isLoading={query.isLoading}\n isError={query.isError}\n error={query.error}\n onRetry={() => void query.refetch()}\n loadingLabel={tr('labsofscience.protocols.loading', 'Loading protocols…')}\n >\n {items.length === 0 ? (\n <EmptyState\n icon={<Microscope className=\"h-10 w-10\" />}\n title={tr('labsofscience.protocols.emptyTitle', 'No protocols found')}\n description={tr(\n 'labsofscience.protocols.emptyDescription',\n 'Capture a reusable method as a versioned protocol.'\n )}\n action={\n <Button onClick={() => setCreateOpen(true)}>\n <Plus className=\"mr-2 h-4 w-4\" />\n {tr('labsofscience.protocols.newButton', 'New protocol')}\n </Button>\n }\n />\n ) : (\n <>\n <ResponsiveTable\n columns={columns}\n data={items}\n rowKey={(row) => row.id}\n onRowClick={(row) => navigateTo(`protocols/${row.id}`)}\n />\n <Pagination\n page={page}\n pageSize={PAGE_SIZE}\n hasNextPage={hasMore}\n hasPreviousPage={page > 1}\n loading={query.isFetching}\n onPageChange={setPage}\n />\n </>\n )}\n </QueryBoundary>\n </div>\n\n <ProtocolFormDialog\n open={createOpen}\n onOpenChange={setCreateOpen}\n onSaved={(protocol) => navigateTo(`protocols/${protocol.id}`)}\n />\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;AA+BA,IAAM,IAAY,IACZ,IAAsC;CAAC;CAAS;CAAa;AAAY;AAE/E,SAAgB,IAAoB;CAClC,IAAM,EAAE,kBAAe,EAAiB,GAClC,IAAK,EAAM,GACX,CAAC,GAAM,KAAW,EAAS,CAAC,GAC5B,CAAC,GAAQ,KAAa,EAAoC,KAAK,GAC/D,CAAC,GAAQ,KAAa,EAAS,EAAE,GACjC,CAAC,GAAY,KAAiB,EAAS,EAAK,GAC5C,IAAkB,EAAkB,EAAO,KAAK,CAAC,GAEjD,IAAQ,EAAa;EACzB,QAAQ,MAAW,QAAQ,KAAA,IAAY;EACvC,QAAQ,KAAmB,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