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,
        }
    }
}