feat(web): add industrial compare page, listing search, and Mapbox park map
- Add interactive Mapbox map to /khu-cong-nghiep landing page with park markers and popups - Build compare page at /khu-cong-nghiep/so-sanh with recharts RadarChart and detailed comparison table - Build listing search page at /khu-cong-nghiep/cho-thue with filters for property type, lease type, area, and price - Add IndustrialListing types, API client functions, and React Query hooks Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
import {
|
||||
industrialApi,
|
||||
type SearchIndustrialListingsParams,
|
||||
type SearchIndustrialParksParams,
|
||||
} from '@/lib/khu-cong-nghiep-api';
|
||||
|
||||
@@ -11,6 +12,7 @@ export const industrialKeys = {
|
||||
stats: () => ['industrial', 'stats'] as const,
|
||||
market: () => ['industrial', 'market'] as const,
|
||||
compare: (ids: string[]) => ['industrial', 'compare', ids] as const,
|
||||
listings: (params: SearchIndustrialListingsParams) => ['industrial', 'listings', params] as const,
|
||||
};
|
||||
|
||||
export function useIndustrialParksSearch(params: SearchIndustrialParksParams = {}) {
|
||||
@@ -51,3 +53,10 @@ export function useIndustrialCompare(ids: string[]) {
|
||||
enabled: ids.length >= 2,
|
||||
});
|
||||
}
|
||||
|
||||
export function useIndustrialListingsSearch(params: SearchIndustrialListingsParams = {}) {
|
||||
return useQuery({
|
||||
queryKey: industrialKeys.listings(params),
|
||||
queryFn: () => industrialApi.searchListings(params),
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user