You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
937 B
37 lines
937 B
import React from 'react'; |
|
import { QueryWindowReducer, QueryWindowState } from "./QueryWindow"; |
|
import { ArtistWindowReducer, ArtistWindowState } from "./ArtistWindow"; |
|
import SearchIcon from '@material-ui/icons/Search'; |
|
import PersonIcon from '@material-ui/icons/Person'; |
|
|
|
export enum WindowType { |
|
Query = "Query", |
|
Artist = "Artist", |
|
} |
|
|
|
export interface WindowState { |
|
tabLabel: string, |
|
} |
|
|
|
export const newWindowReducer = { |
|
[WindowType.Query]: QueryWindowReducer, |
|
[WindowType.Artist]: ArtistWindowReducer, |
|
} |
|
|
|
export const newWindowState = { |
|
[WindowType.Query]: () => { |
|
return { |
|
tabLabel: <><SearchIcon/>Query</>, |
|
editingQuery: false, |
|
query: null, |
|
resultsForQuery: null, |
|
}; |
|
}, |
|
[WindowType.Artist]: () => { |
|
return { |
|
tabLabel: <><PersonIcon/>Artist</>, |
|
artistId: 1, |
|
metadata: null, |
|
} |
|
} |
|
} |