import { cookies } from "next/headers"; import { Fact, ReplicacheProvider } from "src/replicache"; import type { Attribute } from "src/replicache/attributes"; import { ThemeBackgroundProvider, ThemeProvider, } from "components/ThemeManager/ThemeProvider"; import { EntitySetProvider } from "components/EntitySetProvider"; import { getIdentityData } from "actions/getIdentityData"; import { supabaseServerClient } from "supabase/serverClient"; import { NotFoundLayout } from "components/PageLayouts/NotFoundLayout"; import { DashboardLayout } from "components/PageLayouts/DashboardLayout"; import { ReaderContent } from "./ReaderContent"; import { SubscriptionsContent } from "./SubscriptionsContent"; import { getReaderFeed } from "./getReaderFeed"; import { getSubscriptions } from "./getSubscriptions"; export default async function Reader(props: {}) { let cookieStore = await cookies(); let auth_res = await getIdentityData(); let identity: string | undefined; let permission_token = auth_res?.home_leaflet; if (!permission_token) return (

Sorry, we can't find this page!

This may be a glitch on our end. If the issue persists please{" "} send us a note.

); let [homeLeafletFacts] = await Promise.all([ supabaseServerClient.rpc("get_facts", { root: permission_token.root_entity, }), ]); let initialFacts = (homeLeafletFacts.data as unknown as Fact[]) || []; let root_entity = permission_token.root_entity; if (!auth_res?.atp_did) return; let posts = await getReaderFeed(); let publications = await getSubscriptions(); return ( ), }, Subscriptions: { controls: null, content: ( ), }, }} /> ); }