'use client' import { useAuth, LoginButton, LogoutButton } from "../components/auth" import { patreonVideoAccessBenefitId } from "../lib/constants"; import UserControls from "../components/user-controls"; import Skeleton, { SkeletonTheme } from "react-loading-skeleton" import { skeletonHeight, skeletonBorderRadius, skeletonBaseColor, skeletonHighlightColor } from '../lib/constants' export default function Page() { const { authData } = useAuth() const isLoggedIn = (!!authData?.accessToken) const isEntitledToCDN = (!!authData?.user?.patreonBenefits.split(',').includes(patreonVideoAccessBenefitId)) if (!authData) { return
} return ( <>

{authData?.user?.username} Profile

{/* if not logged in, show login button */} { (!authData?.user) && ( ) } {/* if logged in and not patron, display welcome */} { (!!authData?.accessToken && !isEntitledToCDN) && <>

Welcome to Futureporn, {authData?.user?.username || 'chatmember'}! It seems that you are not a patron yet. Please log out and log in again if you believe this is an error. Thank you for your interest!

} {/* if logged in and patron, display profile*/} { (!!authData?.user?.patreonBenefits && isEntitledToCDN) && }
) }