feat: enhance agent sharing functionality and UI improvements

- Added shared agents state management in Navigation and AgentsList components.
- Implemented fetching and displaying shared agents in the AgentsList.
- Introduced functionality to hide shared agents with appropriate API integration.
- Updated the SharedAgent component layout for better UI consistency.
- Improved error handling in conversation fetching logic.
- Added new API endpoint for hiding shared agents.
- Updated Redux slice to manage shared agents state.
- Refactored AgentCard and AgentSection components for better code organization and readability.
This commit is contained in:
Siddhant Rai
2025-05-17 05:53:56 +05:30
parent 9d8073d468
commit 56793c8db7
11 changed files with 296 additions and 213 deletions

View File

@@ -25,6 +25,7 @@ export interface Preference {
modalState: ActiveState;
paginatedDocuments: Doc[] | null;
agents: Agent[] | null;
sharedAgents: Agent[] | null;
selectedAgent: Agent | null;
}
@@ -51,6 +52,7 @@ const initialState: Preference = {
modalState: 'INACTIVE',
paginatedDocuments: null,
agents: null,
sharedAgents: null,
selectedAgent: null,
};
@@ -91,6 +93,9 @@ export const prefSlice = createSlice({
setAgents: (state, action) => {
state.agents = action.payload;
},
setSharedAgents: (state, action) => {
state.sharedAgents = action.payload;
},
setSelectedAgent: (state, action) => {
state.selectedAgent = action.payload;
},
@@ -109,6 +114,7 @@ export const {
setModalStateDeleteConv,
setPaginatedDocuments,
setAgents,
setSharedAgents,
setSelectedAgent,
} = prefSlice.actions;
export default prefSlice.reducer;
@@ -185,5 +191,7 @@ export const selectTokenLimit = (state: RootState) =>
export const selectPaginatedDocuments = (state: RootState) =>
state.preference.paginatedDocuments;
export const selectAgents = (state: RootState) => state.preference.agents;
export const selectSharedAgents = (state: RootState) =>
state.preference.sharedAgents;
export const selectSelectedAgent = (state: RootState) =>
state.preference.selectedAgent;