File size: 458 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import type { ThemeConfig } from '../../../adminjs-options.interface.js'
import { THEME_INITIALIZE } from '../actions/initialize-theme.js'

export type ThemeInState = (ThemeConfig & { availableThemes?: ThemeConfig[] }) | null

export const themeReducer = (
  state: ThemeInState = null,
  action: {
    type: string
    data: ThemeInState
  },
) => {
  switch (action.type) {
  case THEME_INITIALIZE:
    return action.data
  default:
    return state
  }
}