mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-01-07 11:08:52 +01:00
refactor model menu items into component
This commit is contained in:
parent
0bec306e59
commit
62bb6ea8f8
6 changed files with 123 additions and 20 deletions
36
src/store/modelSlice.js
Normal file
36
src/store/modelSlice.js
Normal 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;
|
||||
Loading…
Add table
Add a link
Reference in a new issue