mirror of
https://github.com/pocketbase/pocketbase.git
synced 2026-10-06 22:41:42 +02:00
merge newui branch
This commit is contained in:
1 parent
58f605e90c
commit
4c44044c0c
804 files changed
+58660
-56663
No files matched your search
@@ -0,0 +1,21 @@
|
||||
// {
|
||||
// record: undefined,
|
||||
// field: undefined,
|
||||
// short: false,
|
||||
// }
|
||||
export function view(props) {
|
||||
return t.div({ className: "record-field-view field-type-json" }, () => {
|
||||
const rawValue = props.record[props.field.name];
|
||||
|
||||
if (props.short) {
|
||||
return t.span({
|
||||
className: "txt-code txt-ellipsis",
|
||||
textContent: app.utils.truncate(app.utils.trimQuotedValue(JSON.stringify(rawValue)) || ""),
|
||||
});
|
||||
}
|
||||
|
||||
return app.components.codeBlock({
|
||||
value: () => JSON.stringify(rawValue, null, 2),
|
||||
});
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user