diff --git a/src/components/page/PageView.tsx b/src/components/page/PageView.tsx index 311fe5a..9dfb093 100644 --- a/src/components/page/PageView.tsx +++ b/src/components/page/PageView.tsx @@ -14,11 +14,10 @@ export default function Page({ }: { appRef: React.RefObject; }) { + if (!appRef.current?.page?.kind) return null; + switch (appRef.current?.page?.kind) { case "channel": return ; - - default: - return null; } } diff --git a/src/components/page/channel/ChannelPage.tsx b/src/components/page/channel/ChannelPage.tsx index 0287f87..f9b811b 100644 --- a/src/components/page/channel/ChannelPage.tsx +++ b/src/components/page/channel/ChannelPage.tsx @@ -1,16 +1,16 @@ import Enclave from "@/app/app"; import { ChannelPageProps } from "@/components/page/PageView"; +import TextChannel from "./TextChannel"; export default function ChannelPage({ appRef, }: { appRef: React.RefObject | null>; }) { + if (!appRef.current?.page?.channel.kind) return null; + switch (appRef.current?.page?.channel.kind) { case "text": - return ; - - default: - return null; + return ; } }