feat(form): Add clearable functionality to Select component
This commit introduces a new `clearable` prop to the `Select` component, allowing users to easily reset its value. When the `clearable` prop is set to true, a clear button (an 'X' icon) is displayed when an option is selected. Clicking this button resets the select input to its initial placeholder state and triggers an optional `onClear` callback. To support this, the component's internal state management was refactored to control the input's value. Additionally, the `AdminListFilters` component has been updated to: - Utilize the new clearable select for the status filter. - Consolidate multiple search fields (email, username, full_name) into a single generic "search" input. - Add explicit "Reset" and "Apply" buttons for better filter management.
This commit is contained in:
@@ -1,6 +1,16 @@
|
||||
export * from "./useUsersQueries";
|
||||
export * from "./useCompaniesQueries";
|
||||
export * from "./useTenders";
|
||||
export * from "./useCustomerQueries";
|
||||
export * from "./useFeedbackQueries";
|
||||
export * from "./useProfileQueries";
|
||||
export * from "./useFeedbackQueries"
|
||||
export * from "./useTenders";
|
||||
export * from "./useUsersQueries";
|
||||
|
||||
export * from "./useCompaniesQueries";
|
||||
export * from "./useCustomerQueries";
|
||||
export * from "./useFeedbackQueries";
|
||||
export * from "./useFlagsQueries";
|
||||
export * from "./useNotificationQueries";
|
||||
export * from "./useProfileQueries";
|
||||
export * from "./useTenders";
|
||||
export * from "./useUsersQueries";
|
||||
export * from "./useAdminListQuery";
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
import { API_ENDPOINTS, userService } from "@/lib/api";
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
import { useMemo } from "react";
|
||||
|
||||
export const useGetAdminListQuery = (params?: Record<string, any>) => {
|
||||
const queryKey = useMemo(() => [API_ENDPOINTS.USER.ADMINS, params], [params]);
|
||||
return useQuery({
|
||||
queryKey,
|
||||
queryFn: () => userService.adminsList(params),
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user