import { EmptyState, useCapsule, useData, useTheme } from "@capsule/page"
export default function Mailbox() {
const theme = useTheme()
const { user } = useCapsule()
const threads = useData("threads", { params: { status: "needs-review" } })
if (threads.data?.gmail_connected === false) {
return (
<EmptyState
title="Gmail not connected"
description="Connect Gmail before loading the mailbox."
/>
)
}
return (
<div style={{ color: theme.color.foreground }}>
<p>Signed in as {user?.email}</p>
<h2>Threads: {threads.data?.threads?.length ?? 0}</h2>
</div>
)
}