Add AI auto sales replies for inbox

This commit is contained in:
Loma Bot Ops
2026-11-25 21:31:32 +07:00
parent dd42b81639
commit 89d46ab141
10 changed files with 272 additions and 5 deletions
+5 -1
View File
@@ -3,6 +3,7 @@ import { roleAtLeast } from "@/lib/auth/roles";
import { EmptyState, PageTitle } from "@/components/ui";
import { InboxView } from "@/components/InboxView";
import { PagePicker } from "@/components/PagePicker";
import { InboxAiSettings } from "@/components/InboxAiSettings";
export default async function InboxPage() {
const ctx = await getConsoleContext();
@@ -12,7 +13,10 @@ export default async function InboxPage() {
<>
<PageTitle title="Inbox" subtitle={page ? `Messenger และ Instagram DM ของ ${page.name}` : "เลือกเพจที่จะดูข้อความ"} />
{page ? (
<InboxView key={page.id} pageId={page.id} pageName={page.name} hasInstagram={Boolean(page.igUsername)} canReply={roleAtLeast(page.role, "EDITOR")} />
<>
<InboxAiSettings pageId={page.id} canManage={roleAtLeast(page.role, "APPROVER")} />
<InboxView key={page.id} pageId={page.id} pageName={page.name} hasInstagram={Boolean(page.igUsername)} canReply={roleAtLeast(page.role, "EDITOR")} />
</>
) : (
<section className="card">
<EmptyState icon="inbox" title="Inbox ดูทีละเพจ" hint="เลือกเพจด้านล่าง หรือจากตัวเลือกเพจที่เมนูซ้าย" />