refactor(frontend): clean up code by consolidating multi-line JSX into single lines where feasible
- Refactored JSX elements to improve readability by collapsing multi-line props and attributes into single lines if their length permits. - Improved consistency in component imports by grouping and consolidating them. - No functional changes, purely restructuring for clarity and maintainability.
This commit is contained in:
@@ -44,12 +44,7 @@ const DEFAULT_PAGE_LIMIT = 20;
|
||||
export function useAgentTypes(params: AgentTypeListParams = {}) {
|
||||
const { user } = useAuth();
|
||||
|
||||
const {
|
||||
page = 1,
|
||||
limit = DEFAULT_PAGE_LIMIT,
|
||||
is_active = true,
|
||||
search,
|
||||
} = params;
|
||||
const { page = 1, limit = DEFAULT_PAGE_LIMIT, is_active = true, search } = params;
|
||||
|
||||
return useQuery({
|
||||
queryKey: agentTypeKeys.list({ page, limit, is_active, search }),
|
||||
@@ -152,10 +147,7 @@ export function useUpdateAgentType() {
|
||||
},
|
||||
onSuccess: (updatedAgentType) => {
|
||||
// Update the cache for this specific agent type
|
||||
queryClient.setQueryData(
|
||||
agentTypeKeys.detail(updatedAgentType.id),
|
||||
updatedAgentType
|
||||
);
|
||||
queryClient.setQueryData(agentTypeKeys.detail(updatedAgentType.id), updatedAgentType);
|
||||
// Invalidate lists to reflect changes
|
||||
queryClient.invalidateQueries({ queryKey: agentTypeKeys.lists() });
|
||||
},
|
||||
|
||||
@@ -5,4 +5,8 @@
|
||||
*/
|
||||
|
||||
export { useDebounce } from './useDebounce';
|
||||
export { useProjectEvents, type UseProjectEventsOptions, type UseProjectEventsResult } from './useProjectEvents';
|
||||
export {
|
||||
useProjectEvents,
|
||||
type UseProjectEventsOptions,
|
||||
type UseProjectEventsResult,
|
||||
} from './useProjectEvents';
|
||||
|
||||
@@ -385,7 +385,16 @@ export function useProjectEvents(
|
||||
mountedRef.current = false;
|
||||
cleanup();
|
||||
};
|
||||
}, [autoConnect, isAuthenticated, accessToken, projectId, connectionState, connect, disconnect, cleanup]);
|
||||
}, [
|
||||
autoConnect,
|
||||
isAuthenticated,
|
||||
accessToken,
|
||||
projectId,
|
||||
connectionState,
|
||||
connect,
|
||||
disconnect,
|
||||
cleanup,
|
||||
]);
|
||||
|
||||
return {
|
||||
events,
|
||||
|
||||
@@ -53,10 +53,7 @@ const modelParamsSchema = z.object({
|
||||
* Schema for agent type form fields
|
||||
*/
|
||||
export const agentTypeFormSchema = z.object({
|
||||
name: z
|
||||
.string()
|
||||
.min(1, 'Name is required')
|
||||
.max(255, 'Name must be less than 255 characters'),
|
||||
name: z.string().min(1, 'Name is required').max(255, 'Name must be less than 255 characters'),
|
||||
|
||||
slug: z
|
||||
.string()
|
||||
|
||||
Reference in New Issue
Block a user