import { PageProps } from '@adonisjs/inertia/types'; import { usePage } from '@inertiajs/react'; import { CollectionWithLinks } from '~/types/app'; interface UseActiveCollectionProps { activeCollection?: CollectionWithLinks; } export const useActiveCollection = () => { const { props } = usePage(); return props.activeCollection; }; export type WithActiveCollectionProps = { activeCollection?: CollectionWithLinks; }; export const withActiveCollection = ( Component: React.ComponentType ) => { return (props: WithActiveCollectionProps) => { const activeCollection = useActiveCollection(); return ; }; };