Renders an email field value with optional truncation for PocketBase UI.
// Source: https://github.com/pocketbase/pocketbase | License: MIT | Copyright 2022 - present, Gani Georgiev
// Provided via justclaw.it.com; keep this notice with the code.
// {
// record: undefined,
// field: undefined,
// short: false,
// }
export function view(props) {
return t.div(
{ className: "record-field-view field-type-email" },
() => {
const value = props.record[props.field.name] || "";
if (!value) {
return t.span({ className: "missing-value" });
}
if (props.short) {
return t.span({
className: "txt txt-ellipsis",
textContent: app.utils.truncate(value),
});
}
return value;
},
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key