@latticecms/admin 0.0.0 → 0.1.0
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/README.md +156 -2
- package/dist/admin.css +2 -0
- package/dist/admin.d.ts +18 -0
- package/dist/admin.d.ts.map +1 -0
- package/dist/admin.js +92 -0
- package/dist/admin.js.map +1 -0
- package/dist/catalog.d.ts +45 -0
- package/dist/catalog.d.ts.map +1 -0
- package/dist/catalog.js +147 -0
- package/dist/catalog.js.map +1 -0
- package/dist/collections.d.ts +54 -0
- package/dist/collections.d.ts.map +1 -0
- package/dist/collections.js +103 -0
- package/dist/collections.js.map +1 -0
- package/dist/confirm.d.ts +16 -0
- package/dist/confirm.d.ts.map +1 -0
- package/dist/confirm.js +10 -0
- package/dist/confirm.js.map +1 -0
- package/dist/data.d.ts +28 -0
- package/dist/data.d.ts.map +1 -0
- package/dist/data.js +55 -0
- package/dist/data.js.map +1 -0
- package/dist/delete-action.d.ts +10 -0
- package/dist/delete-action.d.ts.map +1 -0
- package/dist/delete-action.js +44 -0
- package/dist/delete-action.js.map +1 -0
- package/dist/detail-page.d.ts +12 -0
- package/dist/detail-page.d.ts.map +1 -0
- package/dist/detail-page.js +65 -0
- package/dist/detail-page.js.map +1 -0
- package/dist/document-table.d.ts +17 -0
- package/dist/document-table.d.ts.map +1 -0
- package/dist/document-table.js +41 -0
- package/dist/document-table.js.map +1 -0
- package/dist/filters.d.ts +18 -0
- package/dist/filters.d.ts.map +1 -0
- package/dist/filters.js +147 -0
- package/dist/filters.js.map +1 -0
- package/dist/form.d.ts +80 -0
- package/dist/form.d.ts.map +1 -0
- package/dist/form.js +318 -0
- package/dist/form.js.map +1 -0
- package/dist/index-page.d.ts +3 -0
- package/dist/index-page.d.ts.map +1 -0
- package/dist/index-page.js +11 -0
- package/dist/index-page.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/labels.d.ts +13 -0
- package/dist/labels.d.ts.map +1 -0
- package/dist/labels.js +33 -0
- package/dist/labels.js.map +1 -0
- package/dist/list-page.d.ts +25 -0
- package/dist/list-page.d.ts.map +1 -0
- package/dist/list-page.js +82 -0
- package/dist/list-page.js.map +1 -0
- package/dist/list-state.d.ts +17 -0
- package/dist/list-state.d.ts.map +1 -0
- package/dist/list-state.js +39 -0
- package/dist/list-state.js.map +1 -0
- package/dist/method-action.d.ts +16 -0
- package/dist/method-action.d.ts.map +1 -0
- package/dist/method-action.js +78 -0
- package/dist/method-action.js.map +1 -0
- package/dist/model.d.ts +11 -0
- package/dist/model.d.ts.map +1 -0
- package/dist/model.js +16 -0
- package/dist/model.js.map +1 -0
- package/dist/ref-picker.d.ts +24 -0
- package/dist/ref-picker.d.ts.map +1 -0
- package/dist/ref-picker.js +77 -0
- package/dist/ref-picker.js.map +1 -0
- package/dist/refusal-alert.d.ts +12 -0
- package/dist/refusal-alert.d.ts.map +1 -0
- package/dist/refusal-alert.js +87 -0
- package/dist/refusal-alert.js.map +1 -0
- package/dist/refusal.d.ts +20 -0
- package/dist/refusal.d.ts.map +1 -0
- package/dist/refusal.js +40 -0
- package/dist/refusal.js.map +1 -0
- package/dist/relation-tab.d.ts +14 -0
- package/dist/relation-tab.d.ts.map +1 -0
- package/dist/relation-tab.js +205 -0
- package/dist/relation-tab.js.map +1 -0
- package/dist/router.d.ts +50 -0
- package/dist/router.d.ts.map +1 -0
- package/dist/router.js +121 -0
- package/dist/router.js.map +1 -0
- package/dist/schema.d.ts +39 -0
- package/dist/schema.d.ts.map +1 -0
- package/dist/schema.js +113 -0
- package/dist/schema.js.map +1 -0
- package/dist/states.d.ts +18 -0
- package/dist/states.d.ts.map +1 -0
- package/dist/states.js +21 -0
- package/dist/states.js.map +1 -0
- package/dist/value.d.ts +33 -0
- package/dist/value.d.ts.map +1 -0
- package/dist/value.js +96 -0
- package/dist/value.js.map +1 -0
- package/dist/write-pages.d.ts +15 -0
- package/dist/write-pages.d.ts.map +1 -0
- package/dist/write-pages.js +70 -0
- package/dist/write-pages.js.map +1 -0
- package/package.json +77 -2
- package/src/admin.css +14 -0
- package/src/admin.tsx +171 -0
- package/src/catalog.ts +192 -0
- package/src/collections.ts +147 -0
- package/src/confirm.tsx +57 -0
- package/src/data.tsx +94 -0
- package/src/delete-action.tsx +65 -0
- package/src/detail-page.tsx +189 -0
- package/src/document-table.tsx +129 -0
- package/src/filters.tsx +346 -0
- package/src/form.tsx +605 -0
- package/src/index-page.tsx +26 -0
- package/src/index.ts +1 -0
- package/src/labels.ts +41 -0
- package/src/list-page.tsx +191 -0
- package/src/list-state.ts +53 -0
- package/src/method-action.tsx +162 -0
- package/src/model.tsx +29 -0
- package/src/ref-picker.tsx +227 -0
- package/src/refusal-alert.tsx +146 -0
- package/src/refusal.ts +67 -0
- package/src/relation-tab.tsx +440 -0
- package/src/router.tsx +186 -0
- package/src/schema.ts +151 -0
- package/src/states.tsx +67 -0
- package/src/value.tsx +171 -0
- package/src/write-pages.tsx +146 -0
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { Button } from '@shadalaya/react/button';
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import type { Collection } from './collections.js';
|
|
4
|
+
import { ConfirmDialog } from './confirm.js';
|
|
5
|
+
import { useCaller, useRevalidate } from './data.js';
|
|
6
|
+
import { type Refusal, refusalOf } from './refusal.js';
|
|
7
|
+
import { RefusalAlert } from './refusal-alert.js';
|
|
8
|
+
import { useRouter } from './router.js';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Deletes the document after asking, then shows its collection's list. A
|
|
12
|
+
* refusal stays on the page: REFERENCED says what still refers to it.
|
|
13
|
+
*/
|
|
14
|
+
export function DeleteAction({
|
|
15
|
+
collection,
|
|
16
|
+
id,
|
|
17
|
+
}: {
|
|
18
|
+
readonly collection: Collection;
|
|
19
|
+
readonly id: string;
|
|
20
|
+
}) {
|
|
21
|
+
const { href, navigate } = useRouter();
|
|
22
|
+
const call = useCaller();
|
|
23
|
+
const revalidate = useRevalidate('drop');
|
|
24
|
+
const [asking, setAsking] = useState(false);
|
|
25
|
+
const [refusal, setRefusal] = useState<Refusal | undefined>();
|
|
26
|
+
const procedure = collection.operations.delete;
|
|
27
|
+
if (procedure === undefined) return null;
|
|
28
|
+
const remove = async () => {
|
|
29
|
+
setRefusal(undefined);
|
|
30
|
+
try {
|
|
31
|
+
await call(procedure, { id });
|
|
32
|
+
} catch (error) {
|
|
33
|
+
setRefusal(refusalOf(error));
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
// Emptied before the list mounts, and awaited after leaving, so the
|
|
37
|
+
// deleted document's own refetch never shows on its page.
|
|
38
|
+
const dropped = revalidate(collection);
|
|
39
|
+
navigate(href(collection.slug));
|
|
40
|
+
await dropped;
|
|
41
|
+
};
|
|
42
|
+
return (
|
|
43
|
+
<div className="flex flex-col gap-2">
|
|
44
|
+
<Button
|
|
45
|
+
type="button"
|
|
46
|
+
variant="destructive"
|
|
47
|
+
onClick={() => setAsking(true)}
|
|
48
|
+
>
|
|
49
|
+
Delete
|
|
50
|
+
</Button>
|
|
51
|
+
<ConfirmDialog
|
|
52
|
+
confirmation={{
|
|
53
|
+
title: `Delete this ${collection.label.singular}?`,
|
|
54
|
+
description: 'It cannot be brought back.',
|
|
55
|
+
action: 'Delete',
|
|
56
|
+
destructive: true,
|
|
57
|
+
}}
|
|
58
|
+
open={asking}
|
|
59
|
+
onOpenChange={setAsking}
|
|
60
|
+
onConfirm={() => void remove()}
|
|
61
|
+
/>
|
|
62
|
+
{refusal === undefined ? null : <RefusalAlert refusal={refusal} />}
|
|
63
|
+
</div>
|
|
64
|
+
);
|
|
65
|
+
}
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import { buttonVariants } from '@shadalaya/react/button';
|
|
2
|
+
import {
|
|
3
|
+
Card,
|
|
4
|
+
CardContent,
|
|
5
|
+
CardHeader,
|
|
6
|
+
CardTitle,
|
|
7
|
+
} from '@shadalaya/react/card';
|
|
8
|
+
import { isRecord } from './catalog.js';
|
|
9
|
+
import { type Collection, titleFieldOf } from './collections.js';
|
|
10
|
+
import { useCall } from './data.js';
|
|
11
|
+
import { DeleteAction } from './delete-action.js';
|
|
12
|
+
import { pluralHeading, relationLabel, singularHeading } from './labels.js';
|
|
13
|
+
import { isDocumentMethod, MethodAction } from './method-action.js';
|
|
14
|
+
import { refusalOf } from './refusal.js';
|
|
15
|
+
import { RefusalAlert } from './refusal-alert.js';
|
|
16
|
+
import { RelationTab } from './relation-tab.js';
|
|
17
|
+
import { Link, useRouter } from './router.js';
|
|
18
|
+
import { Loading, NotFound } from './states.js';
|
|
19
|
+
import { FieldList } from './value.js';
|
|
20
|
+
|
|
21
|
+
/** The document's fields, then its system fields apart. */
|
|
22
|
+
function DocumentFields({
|
|
23
|
+
collection,
|
|
24
|
+
doc,
|
|
25
|
+
}: {
|
|
26
|
+
readonly collection: Collection;
|
|
27
|
+
readonly doc: Record<string, unknown>;
|
|
28
|
+
}) {
|
|
29
|
+
// A maskable field the caller did not receive is withheld from it.
|
|
30
|
+
const shown = collection.fields.filter(
|
|
31
|
+
(field) => !(field.maskable && doc[field.name] === undefined),
|
|
32
|
+
);
|
|
33
|
+
return (
|
|
34
|
+
<div className="flex flex-col gap-6">
|
|
35
|
+
<FieldList fields={shown.filter((field) => !field.system)} doc={doc} />
|
|
36
|
+
<section aria-label="System fields">
|
|
37
|
+
<FieldList fields={shown.filter((field) => field.system)} doc={doc} />
|
|
38
|
+
</section>
|
|
39
|
+
</div>
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** The document's tabs: its fields, then one per relation. Real links. */
|
|
44
|
+
function Tabs({
|
|
45
|
+
collection,
|
|
46
|
+
id,
|
|
47
|
+
tab,
|
|
48
|
+
}: {
|
|
49
|
+
readonly collection: Collection;
|
|
50
|
+
readonly id: string;
|
|
51
|
+
readonly tab: string | undefined;
|
|
52
|
+
}) {
|
|
53
|
+
const { href } = useRouter();
|
|
54
|
+
if (collection.relations.length === 0) return null;
|
|
55
|
+
const tabs = [
|
|
56
|
+
{ name: undefined, label: 'Details', to: href(collection.slug, id) },
|
|
57
|
+
...collection.relations.map((relation) => ({
|
|
58
|
+
name: relation.name,
|
|
59
|
+
label: relationLabel(relation.name),
|
|
60
|
+
to: href(collection.slug, id, 'relations', relation.name),
|
|
61
|
+
})),
|
|
62
|
+
];
|
|
63
|
+
return (
|
|
64
|
+
<nav aria-label="Tabs" className="flex gap-4 border-b">
|
|
65
|
+
{tabs.map(({ name, label, to }) => (
|
|
66
|
+
<Link
|
|
67
|
+
key={to}
|
|
68
|
+
href={to}
|
|
69
|
+
aria-current={name === tab ? 'page' : undefined}
|
|
70
|
+
className="-mb-px border-b-2 border-transparent px-1 pb-2 aria-[current=page]:border-foreground"
|
|
71
|
+
>
|
|
72
|
+
{label}
|
|
73
|
+
</Link>
|
|
74
|
+
))}
|
|
75
|
+
</nav>
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/** What the document can do: edit, delete, and its methods. */
|
|
80
|
+
function Actions({
|
|
81
|
+
collection,
|
|
82
|
+
id,
|
|
83
|
+
}: {
|
|
84
|
+
readonly collection: Collection;
|
|
85
|
+
readonly id: string;
|
|
86
|
+
}) {
|
|
87
|
+
const { href } = useRouter();
|
|
88
|
+
return (
|
|
89
|
+
<div className="flex flex-wrap items-start gap-2">
|
|
90
|
+
{collection.operations.update === undefined ? null : (
|
|
91
|
+
<Link
|
|
92
|
+
className={buttonVariants({ variant: 'outline' })}
|
|
93
|
+
href={href(collection.slug, id, 'edit')}
|
|
94
|
+
>
|
|
95
|
+
Edit
|
|
96
|
+
</Link>
|
|
97
|
+
)}
|
|
98
|
+
{collection.methods.filter(isDocumentMethod).map((method) => (
|
|
99
|
+
<MethodAction
|
|
100
|
+
key={method.name}
|
|
101
|
+
collection={collection}
|
|
102
|
+
method={method}
|
|
103
|
+
id={id}
|
|
104
|
+
/>
|
|
105
|
+
))}
|
|
106
|
+
<DeleteAction collection={collection} id={id} />
|
|
107
|
+
</div>
|
|
108
|
+
);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* A document's page: `get` with every field `populate` takes, its actions,
|
|
113
|
+
* and a tab per relation.
|
|
114
|
+
*/
|
|
115
|
+
export function DetailPage({
|
|
116
|
+
collection,
|
|
117
|
+
id,
|
|
118
|
+
tab,
|
|
119
|
+
query,
|
|
120
|
+
}: {
|
|
121
|
+
readonly collection: Collection;
|
|
122
|
+
readonly id: string;
|
|
123
|
+
readonly tab: string | undefined;
|
|
124
|
+
readonly query: URLSearchParams;
|
|
125
|
+
}) {
|
|
126
|
+
const { href } = useRouter();
|
|
127
|
+
const { get } = collection.operations;
|
|
128
|
+
const { data, error, isLoading } = useCall(get, {
|
|
129
|
+
id,
|
|
130
|
+
populate: get?.expand ?? [],
|
|
131
|
+
});
|
|
132
|
+
const refusal = error === undefined ? undefined : refusalOf(error);
|
|
133
|
+
const relation = collection.relations.find(({ name }) => name === tab);
|
|
134
|
+
const title = titleFieldOf(collection);
|
|
135
|
+
const doc = isRecord(data) ? data : undefined;
|
|
136
|
+
const heading = title === undefined ? undefined : doc?.[title.name];
|
|
137
|
+
const links = relation === undefined ? undefined : doc?.[relation.name];
|
|
138
|
+
return (
|
|
139
|
+
<section className="flex flex-col gap-4">
|
|
140
|
+
<Link
|
|
141
|
+
className="text-sm text-muted-foreground hover:underline"
|
|
142
|
+
href={href(collection.slug)}
|
|
143
|
+
>
|
|
144
|
+
← {pluralHeading(collection.label)}
|
|
145
|
+
</Link>
|
|
146
|
+
{isLoading && doc === undefined ? <Loading /> : null}
|
|
147
|
+
{refusal?.code === 'NOT_FOUND' ? (
|
|
148
|
+
<NotFound what={`No ${collection.label.singular} with id ${id}.`} />
|
|
149
|
+
) : null}
|
|
150
|
+
{refusal !== undefined && refusal.code !== 'NOT_FOUND' ? (
|
|
151
|
+
<RefusalAlert refusal={refusal} />
|
|
152
|
+
) : null}
|
|
153
|
+
{doc === undefined ? null : (
|
|
154
|
+
<Card>
|
|
155
|
+
<CardHeader className="flex flex-col gap-4">
|
|
156
|
+
<CardTitle>
|
|
157
|
+
<h1 className="text-xl font-semibold">
|
|
158
|
+
{typeof heading === 'string'
|
|
159
|
+
? heading
|
|
160
|
+
: singularHeading(collection.label)}
|
|
161
|
+
</h1>
|
|
162
|
+
</CardTitle>
|
|
163
|
+
<Actions collection={collection} id={id} />
|
|
164
|
+
</CardHeader>
|
|
165
|
+
<CardContent className="flex flex-col gap-6">
|
|
166
|
+
<Tabs collection={collection} id={id} tab={tab} />
|
|
167
|
+
{tab === undefined ? (
|
|
168
|
+
<DocumentFields collection={collection} doc={doc} />
|
|
169
|
+
) : null}
|
|
170
|
+
{tab !== undefined && relation === undefined ? (
|
|
171
|
+
<NotFound what={`No relation "${tab}".`} />
|
|
172
|
+
) : null}
|
|
173
|
+
{relation === undefined ? null : (
|
|
174
|
+
<RelationTab
|
|
175
|
+
// Each relation's tab starts over: its pages and its editor.
|
|
176
|
+
key={relation.name}
|
|
177
|
+
collection={collection}
|
|
178
|
+
relation={relation}
|
|
179
|
+
id={id}
|
|
180
|
+
query={query}
|
|
181
|
+
total={Array.isArray(links) ? links.length : undefined}
|
|
182
|
+
/>
|
|
183
|
+
)}
|
|
184
|
+
</CardContent>
|
|
185
|
+
</Card>
|
|
186
|
+
)}
|
|
187
|
+
</section>
|
|
188
|
+
);
|
|
189
|
+
}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { FieldError } from '@shadalaya/react/field';
|
|
2
|
+
import {
|
|
3
|
+
Table,
|
|
4
|
+
TableBody,
|
|
5
|
+
TableCell,
|
|
6
|
+
TableHead,
|
|
7
|
+
TableHeader,
|
|
8
|
+
TableRow,
|
|
9
|
+
} from '@shadalaya/react/table';
|
|
10
|
+
import type { Collection } from './collections.js';
|
|
11
|
+
import { fieldLabel } from './labels.js';
|
|
12
|
+
import type { Issue } from './refusal.js';
|
|
13
|
+
import { Link, useRouter } from './router.js';
|
|
14
|
+
import type { Field } from './schema.js';
|
|
15
|
+
import { FieldText, FieldValue } from './value.js';
|
|
16
|
+
|
|
17
|
+
/** The next sort a header click makes: ascending, then descending. */
|
|
18
|
+
function nextSort(name: string, sort: string | undefined): string {
|
|
19
|
+
return sort === name ? `-${name}` : name;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function ariaSort(name: string, sort: string | undefined) {
|
|
23
|
+
if (sort === name) return 'ascending';
|
|
24
|
+
if (sort === `-${name}`) return 'descending';
|
|
25
|
+
return undefined;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/** A column header: a sort button when `find` can sort by the field. */
|
|
29
|
+
function ColumnHeader({
|
|
30
|
+
field,
|
|
31
|
+
sortable,
|
|
32
|
+
sort,
|
|
33
|
+
issues,
|
|
34
|
+
onSort,
|
|
35
|
+
}: {
|
|
36
|
+
readonly field: Field;
|
|
37
|
+
readonly sortable: boolean;
|
|
38
|
+
readonly sort: string | undefined;
|
|
39
|
+
readonly issues: readonly Issue[];
|
|
40
|
+
readonly onSort: (sort: string) => void;
|
|
41
|
+
}) {
|
|
42
|
+
const label = fieldLabel(field);
|
|
43
|
+
const direction = ariaSort(field.name, sort);
|
|
44
|
+
if (!sortable) return <TableHead>{label}</TableHead>;
|
|
45
|
+
return (
|
|
46
|
+
<TableHead aria-sort={direction ?? 'none'}>
|
|
47
|
+
<button
|
|
48
|
+
type="button"
|
|
49
|
+
className="inline-flex items-center gap-1 font-medium"
|
|
50
|
+
onClick={() => onSort(nextSort(field.name, sort))}
|
|
51
|
+
>
|
|
52
|
+
{label}
|
|
53
|
+
<span aria-hidden="true">
|
|
54
|
+
{direction === 'ascending'
|
|
55
|
+
? '↑'
|
|
56
|
+
: direction === 'descending'
|
|
57
|
+
? '↓'
|
|
58
|
+
: ''}
|
|
59
|
+
</span>
|
|
60
|
+
</button>
|
|
61
|
+
{direction === undefined ? null : <FieldError errors={[...issues]} />}
|
|
62
|
+
</TableHead>
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* One page of documents, in the list's columns. The first column links to
|
|
68
|
+
* each document. A sort refused as `VALIDATION` shows at its column.
|
|
69
|
+
*/
|
|
70
|
+
export function DocumentTable({
|
|
71
|
+
collection,
|
|
72
|
+
columns,
|
|
73
|
+
docs,
|
|
74
|
+
sortKeys,
|
|
75
|
+
sort,
|
|
76
|
+
sortIssues,
|
|
77
|
+
onSort,
|
|
78
|
+
}: {
|
|
79
|
+
readonly collection: Collection;
|
|
80
|
+
readonly columns: readonly Field[];
|
|
81
|
+
readonly docs: readonly Record<string, unknown>[];
|
|
82
|
+
readonly sortKeys: ReadonlySet<string>;
|
|
83
|
+
readonly sort: string | undefined;
|
|
84
|
+
readonly sortIssues: readonly Issue[];
|
|
85
|
+
readonly onSort: (sort: string) => void;
|
|
86
|
+
}) {
|
|
87
|
+
const { href } = useRouter();
|
|
88
|
+
return (
|
|
89
|
+
<Table>
|
|
90
|
+
<TableHeader>
|
|
91
|
+
<TableRow>
|
|
92
|
+
{columns.map((field) => (
|
|
93
|
+
<ColumnHeader
|
|
94
|
+
key={field.name}
|
|
95
|
+
field={field}
|
|
96
|
+
sortable={sortKeys.has(field.name)}
|
|
97
|
+
sort={sort}
|
|
98
|
+
issues={sortIssues}
|
|
99
|
+
onSort={onSort}
|
|
100
|
+
/>
|
|
101
|
+
))}
|
|
102
|
+
</TableRow>
|
|
103
|
+
</TableHeader>
|
|
104
|
+
<TableBody>
|
|
105
|
+
{docs.map((doc) => {
|
|
106
|
+
const id = typeof doc.id === 'string' ? doc.id : '';
|
|
107
|
+
return (
|
|
108
|
+
<TableRow key={id}>
|
|
109
|
+
{columns.map((field, index) => (
|
|
110
|
+
<TableCell key={field.name}>
|
|
111
|
+
{index === 0 ? (
|
|
112
|
+
<Link
|
|
113
|
+
className="font-medium underline-offset-4 hover:underline"
|
|
114
|
+
href={href(collection.slug, id)}
|
|
115
|
+
>
|
|
116
|
+
<FieldText field={field} value={doc[field.name]} />
|
|
117
|
+
</Link>
|
|
118
|
+
) : (
|
|
119
|
+
<FieldValue field={field} value={doc[field.name]} />
|
|
120
|
+
)}
|
|
121
|
+
</TableCell>
|
|
122
|
+
))}
|
|
123
|
+
</TableRow>
|
|
124
|
+
);
|
|
125
|
+
})}
|
|
126
|
+
</TableBody>
|
|
127
|
+
</Table>
|
|
128
|
+
);
|
|
129
|
+
}
|