forked from mirrors/homebox
feat: link implementation (#100)
* link implementation * add docs for links * use btn instead of badge
This commit is contained in:
parent
97a34475c8
commit
2d34557f69
9 changed files with 120 additions and 6 deletions
|
@ -96,10 +96,25 @@
|
|||
name: "Notes",
|
||||
text: item.value?.notes,
|
||||
},
|
||||
...item.value.fields.map(field => ({
|
||||
name: field.name,
|
||||
text: field.textValue,
|
||||
})),
|
||||
...item.value.fields.map(field => {
|
||||
/**
|
||||
* Support Special URL Syntax
|
||||
*/
|
||||
const url = maybeUrl(field.textValue);
|
||||
if (url.isUrl) {
|
||||
return {
|
||||
name: field.name,
|
||||
text: url.text,
|
||||
type: "link",
|
||||
href: url.url,
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
name: field.name,
|
||||
text: field.textValue,
|
||||
};
|
||||
}),
|
||||
];
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue