@questpie/admin 0.0.1 → 1.0.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.
Files changed (250) hide show
  1. package/README.md +439 -424
  2. package/dist/auth-layout-M8K8_q5R.mjs +181 -0
  3. package/dist/auth-layout-M8K8_q5R.mjs.map +1 -0
  4. package/dist/bulk-upload-dialog-D7w7W1Hl.mjs +273 -0
  5. package/dist/bulk-upload-dialog-D7w7W1Hl.mjs.map +1 -0
  6. package/dist/{components/ui/card.mjs → card-BKHjBQfw.mjs} +8 -8
  7. package/dist/card-BKHjBQfw.mjs.map +1 -0
  8. package/dist/client/styles/index.css +434 -0
  9. package/dist/client-DbpZKSgH.d.mts +13585 -0
  10. package/dist/client-DbpZKSgH.d.mts.map +1 -0
  11. package/dist/client-njX1rZmi.mjs +22612 -0
  12. package/dist/client-njX1rZmi.mjs.map +1 -0
  13. package/dist/client.d.mts +3 -0
  14. package/dist/client.mjs +13 -0
  15. package/dist/content-locales-provider-BXvuIgfg.mjs +1650 -0
  16. package/dist/content-locales-provider-BXvuIgfg.mjs.map +1 -0
  17. package/dist/dashboard-page-B4PGEdc2.mjs +2500 -0
  18. package/dist/dashboard-page-B4PGEdc2.mjs.map +1 -0
  19. package/dist/dashboard-page-mCY0pgZv.mjs +3 -0
  20. package/dist/dropzone-Do3awXKd.mjs +634 -0
  21. package/dist/dropzone-Do3awXKd.mjs.map +1 -0
  22. package/dist/{views/auth/forgot-password-form.mjs → forgot-password-page-Bcp-An4Y.mjs} +87 -14
  23. package/dist/forgot-password-page-Bcp-An4Y.mjs.map +1 -0
  24. package/dist/forgot-password-page-CEwsdLwn.mjs +3 -0
  25. package/dist/index-B9Xwk4hi.d.mts +2753 -0
  26. package/dist/index-B9Xwk4hi.d.mts.map +1 -0
  27. package/dist/index.d.mts +3 -0
  28. package/dist/index.mjs +13 -0
  29. package/dist/login-page-BUnpCbCa.mjs +3 -0
  30. package/dist/login-page-CP4gA-dl.mjs +298 -0
  31. package/dist/login-page-CP4gA-dl.mjs.map +1 -0
  32. package/dist/preview-utils-BKQ9-TMa.mjs +65 -0
  33. package/dist/preview-utils-BKQ9-TMa.mjs.map +1 -0
  34. package/dist/{views/auth/reset-password-form.mjs → reset-password-page-BqfDmLxA.mjs} +111 -14
  35. package/dist/reset-password-page-BqfDmLxA.mjs.map +1 -0
  36. package/dist/reset-password-page-CufHz3h3.mjs +3 -0
  37. package/dist/runtime-6VZM878K.mjs +69 -0
  38. package/dist/runtime-6VZM878K.mjs.map +1 -0
  39. package/dist/saved-views.types-BMsz5mCy.d.mts +42 -0
  40. package/dist/saved-views.types-BMsz5mCy.d.mts.map +1 -0
  41. package/dist/server.d.mts +250 -0
  42. package/dist/server.d.mts.map +1 -0
  43. package/dist/server.mjs +832 -0
  44. package/dist/server.mjs.map +1 -0
  45. package/dist/setup-page-BNNzt_Z6.mjs +3 -0
  46. package/dist/setup-page-YAP_fzqh.mjs +264 -0
  47. package/dist/setup-page-YAP_fzqh.mjs.map +1 -0
  48. package/dist/shared.d.mts +57 -0
  49. package/dist/shared.d.mts.map +1 -0
  50. package/dist/shared.mjs +3 -0
  51. package/dist/{hooks/use-auth.mjs → use-auth-BoLmWtmU.mjs} +42 -30
  52. package/dist/use-auth-BoLmWtmU.mjs.map +1 -0
  53. package/package.json +48 -198
  54. package/.turbo/turbo-build.log +0 -108
  55. package/CHANGELOG.md +0 -10
  56. package/STATUS.md +0 -917
  57. package/VALIDATION.md +0 -602
  58. package/components.json +0 -24
  59. package/dist/__tests__/setup.mjs +0 -38
  60. package/dist/__tests__/test-utils.mjs +0 -45
  61. package/dist/__tests__/vitest.d.mjs +0 -3
  62. package/dist/components/admin-app.mjs +0 -69
  63. package/dist/components/fields/array-field.mjs +0 -190
  64. package/dist/components/fields/checkbox-field.mjs +0 -34
  65. package/dist/components/fields/custom-field.mjs +0 -32
  66. package/dist/components/fields/date-field.mjs +0 -41
  67. package/dist/components/fields/datetime-field.mjs +0 -42
  68. package/dist/components/fields/email-field.mjs +0 -37
  69. package/dist/components/fields/embedded-collection.mjs +0 -253
  70. package/dist/components/fields/field-types.mjs +0 -1
  71. package/dist/components/fields/field-utils.mjs +0 -10
  72. package/dist/components/fields/field-wrapper.mjs +0 -34
  73. package/dist/components/fields/index.mjs +0 -23
  74. package/dist/components/fields/json-field.mjs +0 -243
  75. package/dist/components/fields/locale-badge.mjs +0 -16
  76. package/dist/components/fields/number-field.mjs +0 -39
  77. package/dist/components/fields/password-field.mjs +0 -37
  78. package/dist/components/fields/relation-field.mjs +0 -104
  79. package/dist/components/fields/relation-picker.mjs +0 -229
  80. package/dist/components/fields/relation-select.mjs +0 -188
  81. package/dist/components/fields/rich-text-editor/index.mjs +0 -897
  82. package/dist/components/fields/select-field.mjs +0 -41
  83. package/dist/components/fields/switch-field.mjs +0 -34
  84. package/dist/components/fields/text-field.mjs +0 -38
  85. package/dist/components/fields/textarea-field.mjs +0 -38
  86. package/dist/components/index.mjs +0 -59
  87. package/dist/components/primitives/checkbox-input.mjs +0 -127
  88. package/dist/components/primitives/date-input.mjs +0 -303
  89. package/dist/components/primitives/index.mjs +0 -12
  90. package/dist/components/primitives/number-input.mjs +0 -104
  91. package/dist/components/primitives/select-input.mjs +0 -177
  92. package/dist/components/primitives/tag-input.mjs +0 -135
  93. package/dist/components/primitives/text-input.mjs +0 -39
  94. package/dist/components/primitives/textarea-input.mjs +0 -37
  95. package/dist/components/primitives/toggle-input.mjs +0 -31
  96. package/dist/components/primitives/types.mjs +0 -12
  97. package/dist/components/ui/accordion.mjs +0 -55
  98. package/dist/components/ui/avatar.mjs +0 -54
  99. package/dist/components/ui/badge.mjs +0 -34
  100. package/dist/components/ui/button.mjs +0 -48
  101. package/dist/components/ui/checkbox.mjs +0 -21
  102. package/dist/components/ui/combobox.mjs +0 -163
  103. package/dist/components/ui/dialog.mjs +0 -95
  104. package/dist/components/ui/dropdown-menu.mjs +0 -138
  105. package/dist/components/ui/field.mjs +0 -113
  106. package/dist/components/ui/input-group.mjs +0 -82
  107. package/dist/components/ui/input.mjs +0 -17
  108. package/dist/components/ui/label.mjs +0 -15
  109. package/dist/components/ui/popover.mjs +0 -56
  110. package/dist/components/ui/scroll-area.mjs +0 -38
  111. package/dist/components/ui/select.mjs +0 -100
  112. package/dist/components/ui/separator.mjs +0 -16
  113. package/dist/components/ui/sheet.mjs +0 -90
  114. package/dist/components/ui/sidebar.mjs +0 -387
  115. package/dist/components/ui/skeleton.mjs +0 -14
  116. package/dist/components/ui/spinner.mjs +0 -16
  117. package/dist/components/ui/switch.mjs +0 -22
  118. package/dist/components/ui/table.mjs +0 -68
  119. package/dist/components/ui/tabs.mjs +0 -48
  120. package/dist/components/ui/textarea.mjs +0 -15
  121. package/dist/components/ui/tooltip.mjs +0 -44
  122. package/dist/config/component-registry.mjs +0 -38
  123. package/dist/config/index.mjs +0 -129
  124. package/dist/hooks/admin-provider.mjs +0 -70
  125. package/dist/hooks/index.mjs +0 -7
  126. package/dist/hooks/store.mjs +0 -178
  127. package/dist/hooks/use-collection-db.mjs +0 -146
  128. package/dist/hooks/use-collection.mjs +0 -112
  129. package/dist/hooks/use-global.mjs +0 -46
  130. package/dist/hooks/use-mobile.mjs +0 -20
  131. package/dist/lib/utils.mjs +0 -10
  132. package/dist/styles/index.css +0 -336
  133. package/dist/styles/index.mjs +0 -1
  134. package/dist/utils/index.mjs +0 -9
  135. package/dist/views/auth/auth-layout.mjs +0 -52
  136. package/dist/views/auth/index.mjs +0 -6
  137. package/dist/views/auth/login-form.mjs +0 -156
  138. package/dist/views/collection/auto-form-fields.mjs +0 -525
  139. package/dist/views/collection/collection-form.mjs +0 -91
  140. package/dist/views/collection/collection-list.mjs +0 -76
  141. package/dist/views/collection/form-field.mjs +0 -42
  142. package/dist/views/collection/index.mjs +0 -6
  143. package/dist/views/common/index.mjs +0 -4
  144. package/dist/views/common/locale-switcher.mjs +0 -39
  145. package/dist/views/common/version-history.mjs +0 -272
  146. package/dist/views/index.mjs +0 -9
  147. package/dist/views/layout/admin-layout.mjs +0 -40
  148. package/dist/views/layout/admin-router.mjs +0 -95
  149. package/dist/views/layout/admin-sidebar.mjs +0 -63
  150. package/dist/views/layout/index.mjs +0 -5
  151. package/src/__tests__/setup.ts +0 -44
  152. package/src/__tests__/test-utils.tsx +0 -49
  153. package/src/__tests__/vitest.d.ts +0 -9
  154. package/src/components/admin-app.tsx +0 -221
  155. package/src/components/fields/array-field.tsx +0 -237
  156. package/src/components/fields/checkbox-field.tsx +0 -47
  157. package/src/components/fields/custom-field.tsx +0 -50
  158. package/src/components/fields/date-field.tsx +0 -65
  159. package/src/components/fields/datetime-field.tsx +0 -67
  160. package/src/components/fields/email-field.tsx +0 -51
  161. package/src/components/fields/embedded-collection.tsx +0 -315
  162. package/src/components/fields/field-types.ts +0 -162
  163. package/src/components/fields/field-utils.ts +0 -6
  164. package/src/components/fields/field-wrapper.tsx +0 -52
  165. package/src/components/fields/index.ts +0 -66
  166. package/src/components/fields/json-field.tsx +0 -440
  167. package/src/components/fields/locale-badge.tsx +0 -15
  168. package/src/components/fields/number-field.tsx +0 -57
  169. package/src/components/fields/password-field.tsx +0 -51
  170. package/src/components/fields/relation-field.tsx +0 -243
  171. package/src/components/fields/relation-picker.tsx +0 -402
  172. package/src/components/fields/relation-select.tsx +0 -327
  173. package/src/components/fields/rich-text-editor/index.tsx +0 -1337
  174. package/src/components/fields/select-field.tsx +0 -61
  175. package/src/components/fields/switch-field.tsx +0 -47
  176. package/src/components/fields/text-field.tsx +0 -55
  177. package/src/components/fields/textarea-field.tsx +0 -55
  178. package/src/components/index.ts +0 -40
  179. package/src/components/primitives/checkbox-input.tsx +0 -193
  180. package/src/components/primitives/date-input.tsx +0 -401
  181. package/src/components/primitives/index.ts +0 -24
  182. package/src/components/primitives/number-input.tsx +0 -132
  183. package/src/components/primitives/select-input.tsx +0 -296
  184. package/src/components/primitives/tag-input.tsx +0 -200
  185. package/src/components/primitives/text-input.tsx +0 -49
  186. package/src/components/primitives/textarea-input.tsx +0 -46
  187. package/src/components/primitives/toggle-input.tsx +0 -36
  188. package/src/components/primitives/types.ts +0 -235
  189. package/src/components/ui/accordion.tsx +0 -72
  190. package/src/components/ui/avatar.tsx +0 -106
  191. package/src/components/ui/badge.tsx +0 -48
  192. package/src/components/ui/button.tsx +0 -53
  193. package/src/components/ui/card.tsx +0 -94
  194. package/src/components/ui/checkbox.tsx +0 -27
  195. package/src/components/ui/combobox.tsx +0 -290
  196. package/src/components/ui/dialog.tsx +0 -151
  197. package/src/components/ui/dropdown-menu.tsx +0 -254
  198. package/src/components/ui/field.tsx +0 -227
  199. package/src/components/ui/input-group.tsx +0 -149
  200. package/src/components/ui/input.tsx +0 -20
  201. package/src/components/ui/label.tsx +0 -18
  202. package/src/components/ui/popover.tsx +0 -88
  203. package/src/components/ui/scroll-area.tsx +0 -53
  204. package/src/components/ui/select.tsx +0 -192
  205. package/src/components/ui/separator.tsx +0 -23
  206. package/src/components/ui/sheet.tsx +0 -127
  207. package/src/components/ui/sidebar.tsx +0 -723
  208. package/src/components/ui/skeleton.tsx +0 -13
  209. package/src/components/ui/spinner.tsx +0 -10
  210. package/src/components/ui/switch.tsx +0 -32
  211. package/src/components/ui/table.tsx +0 -99
  212. package/src/components/ui/tabs.tsx +0 -82
  213. package/src/components/ui/textarea.tsx +0 -18
  214. package/src/components/ui/tooltip.tsx +0 -70
  215. package/src/config/component-registry.ts +0 -190
  216. package/src/config/index.ts +0 -1099
  217. package/src/hooks/README.md +0 -269
  218. package/src/hooks/admin-provider.tsx +0 -110
  219. package/src/hooks/index.ts +0 -41
  220. package/src/hooks/store.ts +0 -248
  221. package/src/hooks/use-auth.ts +0 -168
  222. package/src/hooks/use-collection-db.ts +0 -209
  223. package/src/hooks/use-collection.ts +0 -156
  224. package/src/hooks/use-global.ts +0 -69
  225. package/src/hooks/use-mobile.ts +0 -21
  226. package/src/lib/utils.ts +0 -6
  227. package/src/styles/index.css +0 -340
  228. package/src/utils/index.ts +0 -6
  229. package/src/views/auth/auth-layout.tsx +0 -77
  230. package/src/views/auth/forgot-password-form.tsx +0 -192
  231. package/src/views/auth/index.ts +0 -21
  232. package/src/views/auth/login-form.tsx +0 -229
  233. package/src/views/auth/reset-password-form.tsx +0 -232
  234. package/src/views/collection/auto-form-fields.tsx +0 -982
  235. package/src/views/collection/collection-form.tsx +0 -186
  236. package/src/views/collection/collection-list.tsx +0 -223
  237. package/src/views/collection/form-field.tsx +0 -52
  238. package/src/views/collection/index.ts +0 -15
  239. package/src/views/common/index.ts +0 -8
  240. package/src/views/common/locale-switcher.tsx +0 -45
  241. package/src/views/common/version-history.tsx +0 -406
  242. package/src/views/index.ts +0 -25
  243. package/src/views/layout/admin-layout.tsx +0 -117
  244. package/src/views/layout/admin-router.tsx +0 -206
  245. package/src/views/layout/admin-sidebar.tsx +0 -185
  246. package/src/views/layout/index.ts +0 -12
  247. package/tsconfig.json +0 -13
  248. package/tsconfig.tsbuildinfo +0 -1
  249. package/tsdown.config.ts +0 -13
  250. package/vitest.config.ts +0 -29
@@ -1,327 +0,0 @@
1
- /**
2
- * RelationSelect Component
3
- *
4
- * Single relation field (one-to-one) with:
5
- * - Select dropdown to choose existing item
6
- * - Plus button to create new related item (opens side sheet)
7
- * - Edit button to modify selected item (opens side sheet)
8
- */
9
-
10
- import * as React from "react";
11
- import { useQuery } from "@tanstack/react-query";
12
- import { Plus, Pencil, X } from "@phosphor-icons/react";
13
- import { Button } from "../ui/button";
14
- import { Select, SelectContent, SelectItem, SelectTrigger } from "../ui/select";
15
- import {
16
- Sheet,
17
- SheetContent,
18
- SheetDescription,
19
- SheetHeader,
20
- SheetTitle,
21
- } from "../ui/sheet";
22
- import { Spinner } from "../ui/spinner";
23
- import { LocaleBadge } from "./locale-badge";
24
- import { useAdminContext } from "../../hooks/admin-provider";
25
- import type { Questpie } from "questpie";
26
-
27
- export interface RelationSelectProps<T extends Questpie<any>> {
28
- /**
29
- * Field name
30
- */
31
- name: string;
32
-
33
- /**
34
- * Current value (ID of related item)
35
- */
36
- value?: string | null;
37
-
38
- /**
39
- * Change handler
40
- */
41
- onChange: (value: string | null) => void;
42
-
43
- /**
44
- * Target collection name
45
- */
46
- targetCollection: string;
47
-
48
- /**
49
- * Label for the field
50
- */
51
- label?: string;
52
-
53
- /**
54
- * Localized field
55
- */
56
- localized?: boolean;
57
-
58
- /**
59
- * Active locale
60
- */
61
- locale?: string;
62
-
63
- /**
64
- * Filter options based on form values
65
- */
66
- filter?: (formValues: any) => any;
67
-
68
- /**
69
- * Is the field required
70
- */
71
- required?: boolean;
72
-
73
- /**
74
- * Is the field disabled
75
- */
76
- disabled?: boolean;
77
-
78
- /**
79
- * Is the field readonly
80
- */
81
- readOnly?: boolean;
82
-
83
- /**
84
- * Placeholder text
85
- */
86
- placeholder?: string;
87
-
88
- /**
89
- * Error message
90
- */
91
- error?: string;
92
-
93
- /**
94
- * Custom render function for dropdown options
95
- */
96
- renderOption?: (item: any) => React.ReactNode;
97
-
98
- /**
99
- * Custom render function for selected value
100
- */
101
- renderValue?: (item: any) => React.ReactNode;
102
-
103
- /**
104
- * Form fields to render in create/edit sheet
105
- */
106
- renderFormFields?: (collection: string, itemId?: string) => React.ReactNode;
107
- }
108
-
109
- export function RelationSelect<T extends Questpie<any>>({
110
- name,
111
- value,
112
- onChange,
113
- targetCollection,
114
- label,
115
- filter,
116
- required,
117
- disabled,
118
- readOnly,
119
- placeholder,
120
- error,
121
- localized,
122
- locale: localeProp,
123
- renderOption,
124
- renderValue,
125
- renderFormFields,
126
- }: RelationSelectProps<T>) {
127
- const { client, locale: contextLocale } = useAdminContext<T>();
128
- const locale = localeProp ?? contextLocale;
129
- const localeKey = locale ?? "default";
130
- const [isSheetOpen, setIsSheetOpen] = React.useState(false);
131
- const [sheetMode, setSheetMode] = React.useState<"create" | "edit">("create");
132
-
133
- // Fetch options for dropdown
134
- const { data: options, isLoading } = useQuery({
135
- queryKey: ["relation", targetCollection, localeKey, filter],
136
- queryFn: async () => {
137
- const api = (client as any).collections?.[targetCollection];
138
- if (!api?.list) return [];
139
- const result = await api.list({
140
- ...(filter ? filter({}) : {}),
141
- });
142
- return result.data || [];
143
- },
144
- });
145
-
146
- // Fetch selected item details
147
- const { data: selectedItem } = useQuery({
148
- queryKey: ["relation", targetCollection, localeKey, value],
149
- queryFn: async () => {
150
- if (!value) return null;
151
- const api = (client as any).collections?.[targetCollection];
152
- if (!api?.get) return null;
153
- return await api.get(value);
154
- },
155
- enabled: !!value,
156
- });
157
-
158
- const handleOpenCreate = () => {
159
- setSheetMode("create");
160
- setIsSheetOpen(true);
161
- };
162
-
163
- const handleOpenEdit = () => {
164
- if (!value) return;
165
- setSheetMode("edit");
166
- setIsSheetOpen(true);
167
- };
168
-
169
- const handleClear = () => {
170
- onChange(null);
171
- };
172
-
173
- const handleValueChange = (newValue: string | null) => {
174
- if (newValue) {
175
- onChange(newValue);
176
- }
177
- };
178
-
179
- const getDisplayValue = (item: any) => {
180
- if (renderValue) return renderValue(item);
181
- return item?._title || item?.id || "";
182
- };
183
-
184
- const getOptionDisplay = (item: any) => {
185
- if (renderOption) return renderOption(item);
186
- return item?._title || item?.id || "";
187
- };
188
-
189
- return (
190
- <div className="space-y-2">
191
- {label && (
192
- <div className="flex items-center gap-2">
193
- <label htmlFor={name} className="text-sm font-medium">
194
- {label}
195
- {required && <span className="text-destructive">*</span>}
196
- </label>
197
- {localized && <LocaleBadge locale={locale || "i18n"} />}
198
- </div>
199
- )}
200
-
201
- <div className="flex gap-2">
202
- {/* Select Dropdown */}
203
- <div className="flex-1">
204
- <Select
205
- value={value || undefined}
206
- onValueChange={handleValueChange}
207
- disabled={disabled || readOnly || isLoading}
208
- >
209
- <SelectTrigger
210
- id={name}
211
- className={error ? "border-destructive" : ""}
212
- >
213
- <span className="truncate">
214
- {selectedItem
215
- ? getDisplayValue(selectedItem)
216
- : placeholder || `Select ${label || targetCollection}...`}
217
- </span>
218
- </SelectTrigger>
219
- <SelectContent>
220
- {isLoading ? (
221
- <div className="flex items-center justify-center p-4">
222
- <Spinner className="h-4 w-4" />
223
- </div>
224
- ) : options && options.length > 0 ? (
225
- options.map((option: any) => (
226
- <SelectItem key={option.id} value={option.id}>
227
- {getOptionDisplay(option)}
228
- </SelectItem>
229
- ))
230
- ) : (
231
- <div className="p-4 text-center text-sm text-muted-foreground">
232
- No options available
233
- </div>
234
- )}
235
- </SelectContent>
236
- </Select>
237
- </div>
238
-
239
- {/* Action Buttons */}
240
- {!readOnly && (
241
- <>
242
- {/* Clear button (only if value is set and not required) */}
243
- {value && !required && (
244
- <Button
245
- type="button"
246
- variant="outline"
247
- size="icon"
248
- onClick={handleClear}
249
- disabled={disabled}
250
- title="Clear selection"
251
- >
252
- <X className="h-4 w-4" />
253
- </Button>
254
- )}
255
-
256
- {/* Edit button (only if value is set) */}
257
- {value && (
258
- <Button
259
- type="button"
260
- variant="outline"
261
- size="icon"
262
- onClick={handleOpenEdit}
263
- disabled={disabled}
264
- title={`Edit ${label || targetCollection}`}
265
- >
266
- <Pencil className="h-4 w-4" />
267
- </Button>
268
- )}
269
-
270
- {/* Create button */}
271
- <Button
272
- type="button"
273
- variant="outline"
274
- size="icon"
275
- onClick={handleOpenCreate}
276
- disabled={disabled}
277
- title={`Create new ${label || targetCollection}`}
278
- >
279
- <Plus className="h-4 w-4" />
280
- </Button>
281
- </>
282
- )}
283
- </div>
284
-
285
- {/* Error message */}
286
- {error && <p className="text-sm text-destructive">{error}</p>}
287
-
288
- {/* Side Sheet for Create/Edit */}
289
- <Sheet open={isSheetOpen} onOpenChange={setIsSheetOpen}>
290
- <SheetContent
291
- side="right"
292
- className="w-full sm:max-w-lg overflow-y-auto"
293
- >
294
- <SheetHeader>
295
- <SheetTitle>
296
- {sheetMode === "create" ? "Create" : "Edit"}{" "}
297
- {label || targetCollection}
298
- </SheetTitle>
299
- <SheetDescription>
300
- {sheetMode === "create"
301
- ? `Fill in the details to create a new ${label || targetCollection}`
302
- : `Update the details of this ${label || targetCollection}`}
303
- </SheetDescription>
304
- </SheetHeader>
305
-
306
- <div className="mt-6">
307
- {renderFormFields ? (
308
- renderFormFields(
309
- targetCollection,
310
- sheetMode === "edit" ? value || undefined : undefined,
311
- )
312
- ) : (
313
- <div className="rounded-lg border border-dashed p-8 text-center">
314
- <p className="text-sm text-muted-foreground">
315
- Form fields not configured.
316
- <br />
317
- Pass <code className="text-xs">renderFormFields</code> prop to
318
- enable create/edit.
319
- </p>
320
- </div>
321
- )}
322
- </div>
323
- </SheetContent>
324
- </Sheet>
325
- </div>
326
- );
327
- }