refactor: model instance item

This commit is contained in:
jialin
2026-03-26 18:20:55 +08:00
committed by jialin
parent a95b7e9561
commit 33fe180997
15 changed files with 1057 additions and 765 deletions
+10
View File
@@ -0,0 +1,10 @@
export default function useActions<T>(actions: Global.ActionItem<T>[], ctx: T) {
return actions
.filter((action) => {
return action.visible ? action.visible(ctx) : true;
})
.map((action) => ({
...action,
disabled: action.disabled?.(ctx)
}));
}