mirror of https://git.lenooby09.tech/LeNooby09/social-app.git
at ruby-v 14 lines 391 B view raw
1import {ThemeName} from '#/alf/types' 2 3export function select<T>(name: ThemeName, options: Record<ThemeName, T>) { 4 switch (name) { 5 case 'light': 6 return options.light 7 case 'dark': 8 return options.dark || options.dim 9 case 'dim': 10 return options.dim || options.dark 11 default: 12 throw new Error(`select(theme, options) received unknown theme ${name}`) 13 } 14}