Boards components.

This commit is contained in:
Mike Cao committed 2025-11-29 15:59:01 -08:00
1 parent 7edddf15a7
commit a39ebffd8b
20 files changed
+450 -33

No files matched your search

+1 -1
View File
@@ -76,7 +76,7 @@ export function DataGrid({
</Row>
)}
<LoadingPanel
data={data}
data={data?.data}
isLoading={isLoading}
isFetching={isFetching}
error={error}
+2
View File
@@ -29,6 +29,8 @@ export function LoadingPanel({
}: LoadingPanelProps): ReactNode {
const empty = isEmpty ?? checkEmpty(data);
console.log({ empty, isEmpty, data });
// Show loading spinner only if no data exists
if (isLoading || isFetching) {
return (
+1
View File
@@ -9,6 +9,7 @@ export * from './context/useWebsite';
// Query hooks
export * from './queries/useActiveUsersQuery';
export * from './queries/useBoardsQuery';
export * from './queries/useDateRangeQuery';
export * from './queries/useDeleteQuery';
export * from './queries/useEventDataEventsQuery';
@@ -0,0 +1,17 @@
import type { ReactQueryOptions } from '@/lib/types';
import { useApi } from '../useApi';
import { useModified } from '../useModified';
import { usePagedQuery } from '../usePagedQuery';
export function useBoardsQuery({ teamId }: { teamId?: string }, options?: ReactQueryOptions) {
const { modified } = useModified('boards');
const { get } = useApi();
return usePagedQuery({
queryKey: ['boards', { teamId, modified }],
queryFn: pageParams => {
return get(teamId ? `/teams/${teamId}/boards` : '/boards', pageParams);
},
...options,
});
}