auth loading
) - if (loaderElement) return loaderElement + + // use global loader for auth checks as it blocks the entire app + useEffect(() => { + if (loading) { + startLoading() + } else { + stopLoading() + } + }, [loading]) + + if (loading) return null if (!isLoggedIn) return ( diff --git a/frontend/src/components/api/DisplayResourceGeneric.tsx b/frontend/src/components/api/DisplayResourceGeneric.tsx new file mode 100644 index 0000000..c113c81 --- /dev/null +++ b/frontend/src/components/api/DisplayResourceGeneric.tsx @@ -0,0 +1,65 @@ +import { useEffect, useState, type MouseEvent } from 'react' +import { Link, useSearchParams } from 'react-router-dom' +import { useResource } from '../../hooks/load/useResource.ts' +import ShowLoader from '../load/ShowLoader.tsx' + +export type Item = { + id: number + name: string +} + +type Props = { + fetchFn: (page: number) => Promisehard coded for now:
-