diff --git a/src/app/profile/page.tsx b/src/app/profile/page.tsx index 1440b3a..0b88028 100644 --- a/src/app/profile/page.tsx +++ b/src/app/profile/page.tsx @@ -13,6 +13,7 @@ import EditModal from './components/editModal' import { getProfileCompletion } from './hooks/getProfileCompletion' import { useProfileData } from './hooks/getProfileData' import { useMedia } from './hooks/getMedia' +import { useMyAbonements } from './hooks/getAbo' import { editProfileBasic } from './hooks/editProfile' import { authFetch } from '../utils/authFetch' @@ -105,6 +106,7 @@ export default function ProfilePage() { // Fetch hooks can run with undefined userId; they should handle it internally const { data: profileDataApi, loading: profileLoading } = useProfileData(userId, refreshKey) const { data: mediaData, loading: mediaLoading } = useMedia(userId, refreshKey) + const { data: subscriptions, loading: subscriptionsLoading, error: subscriptionsError } = useMyAbonements(refreshKey) // Redirect only after hydration + auth ready useEffect(() => { @@ -407,6 +409,38 @@ export default function ProfilePage() { Open subscriptions + +
Loading subscriptions…
+ ) : subscriptionsError ? ( +{subscriptionsError}
+ ) : subscriptions.length === 0 ? ( +You don’t have any subscriptions yet.
+ ) : ( +{subscription.name || `Subscription #${subscription.id}`}
+Started: {startedLabel} • Packs: {packs}
+