mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-09-04 07:41:50 +08:00
16 lines
450 B
TypeScript
16 lines
450 B
TypeScript
import { html, type TemplateResult } from 'lit';
|
|
|
|
import type { MenuConfig } from './menu.js';
|
|
import type { MenuItemRender } from './types.js';
|
|
|
|
export const menuDynamicItems = {
|
|
dynamic: (config: () => MenuConfig[]) => menu => {
|
|
const items = menu.renderItems(config());
|
|
if (!items.length) {
|
|
return;
|
|
}
|
|
const result: TemplateResult = html`${items}`;
|
|
return result;
|
|
},
|
|
} satisfies Record<string, MenuItemRender<never>>;
|