Refine edit layouts and share states

This commit is contained in:
Mike Cao committed 2026-03-10 02:52:13 -07:00
1 parent cdcb1f379b
commit 6b8159e535
9 files changed
+164 -153

No files matched your search

+22
View File
@@ -0,0 +1,22 @@
import type { BoardEntityType } from './boards';
export const BOARD_COMPONENT_COMPATIBILITY_MATRIX = {
EventsChart: ['website'],
} as const satisfies Partial<Record<string, readonly BoardEntityType[]>>;
export function getSupportedBoardComponentEntityTypes(componentType: string) {
return BOARD_COMPONENT_COMPATIBILITY_MATRIX[componentType];
}
export function isBoardComponentSupportedByEntityType(
componentType: string,
entityType?: BoardEntityType,
) {
const supportedEntityTypes = getSupportedBoardComponentEntityTypes(componentType);
if (!entityType || !supportedEntityTypes) {
return true;
}
return supportedEntityTypes.includes(entityType);
}