removed the old event admin components and pages

This commit is contained in:
Codex Agent
2025-12-12 13:38:06 +01:00
parent bbf8d4a0f4
commit 1719d96fed
85 changed files with 994 additions and 19981 deletions

View File

@@ -0,0 +1,16 @@
import type { EventAddonCatalogItem } from '../api';
export const scopeDefaults: Record<'photos' | 'gallery', string[]> = {
photos: ['extra_photos_500', 'extra_photos_2000'],
gallery: ['extend_gallery_30d', 'extend_gallery_90d'],
};
export function selectAddonKeyForScope(addons: EventAddonCatalogItem[], scope: 'photos' | 'gallery'): string {
const fallback = scope === 'photos' ? 'extra_photos_500' : 'extend_gallery_30d';
const filtered = addons.filter((addon) => addon.price_id && scopeDefaults[scope].includes(addon.key));
if (filtered.length) {
return filtered[0].key;
}
const scoped = addons.find((addon) => addon.price_id && addon.key.includes(scope));
return scoped?.key ?? fallback;
}