refactor model menu items into component

This commit is contained in:
Daniel Avila 2023-03-03 21:33:09 -05:00
parent 0bec306e59
commit 62bb6ea8f8
6 changed files with 123 additions and 20 deletions

36
src/store/modelSlice.js Normal file
View file

@ -0,0 +1,36 @@
import { createSlice } from '@reduxjs/toolkit';
const initialState = {
models: [
{
name: 'ChatGPT',
value: 'chatgpt'
},
{
name: 'CustomGPT',
value: 'chatgptCustom'
},
{
name: 'BingAI',
value: 'bingai'
},
{
name: 'ChatGPT',
value: 'chatgptBrowser'
}
]
};
const currentSlice = createSlice({
name: 'models',
initialState,
reducers: {
setModels: (state, action) => {
state.models = [...state.models, ...action.payload];
}
}
});
export const { setModels } = currentSlice.actions;
export default currentSlice.reducer;