Files
Jonathan Adeline 38ccc54c2e chore: update Iconoir to 7.12.2 (#7012)
* chore(deps): update Iconoir to 7.12.2

* test: update grid visibility selector for Iconoir 7

* fix: restore open and slashed eye icons

* docs: document Iconoir 7 plugin changes
2026-12-04 15:36:56 +04:00

41 lines
948 B
JavaScript

export const STATES = {
private: {
color: 'neutral',
icon: 'baserow-icon-eye-off',
label: 'userTemplateList.statePrivate',
},
in_review: {
color: 'yellow',
icon: 'iconoir-clock',
label: 'userTemplateList.stateInReview',
},
rejected: {
color: 'red',
icon: 'baserow-icon-eye-off',
label: 'userTemplateList.stateRejected',
},
blocked: {
color: 'red',
icon: 'iconoir-warning-triangle',
label: 'userTemplateList.stateBlocked',
},
public: {
color: 'green',
icon: 'baserow-icon-eye',
label: 'userTemplateList.statePublic',
},
}
export function getState(state, t) {
const known = STATES[state]
return known
? { color: known.color, icon: known.icon, label: t(known.label) }
: { color: 'neutral', icon: null, label: state }
}
export function showsListed(template) {
return Boolean(
template.listed && ['in_review', 'rejected'].includes(template.state)
)
}