chore: initial project import
Some checks failed
CI - Production Readiness / Verify (push) Has been cancelled
Some checks failed
CI - Production Readiness / Verify (push) Has been cancelled
This commit is contained in:
54
app/inbox/page.tsx
Normal file
54
app/inbox/page.tsx
Normal file
@ -0,0 +1,54 @@
|
||||
import { InboxPlaceholder } from "@/components/placeholders";
|
||||
import { PlaceholderActions, ShellPage } from "@/components/page-templates";
|
||||
import {
|
||||
addConversationNote,
|
||||
assignConversation,
|
||||
getInboxWorkspace,
|
||||
replyToConversation,
|
||||
setConversationTags,
|
||||
updateConversationStatus
|
||||
} from "@/lib/inbox-ops";
|
||||
|
||||
const allowedFilters = ["all", "open", "pending", "resolved", "unassigned"] as const;
|
||||
|
||||
export default async function InboxPage({
|
||||
searchParams
|
||||
}: {
|
||||
searchParams: Promise<{ conversationId?: string; filter?: string }>;
|
||||
}) {
|
||||
const params = await searchParams;
|
||||
const filter =
|
||||
params?.filter && allowedFilters.includes(params.filter as (typeof allowedFilters)[number])
|
||||
? (params.filter as (typeof allowedFilters)[number])
|
||||
: "all";
|
||||
|
||||
const data = await getInboxWorkspace({
|
||||
scope: "admin",
|
||||
conversationId: params?.conversationId,
|
||||
filter
|
||||
});
|
||||
|
||||
return (
|
||||
<ShellPage
|
||||
shell="admin"
|
||||
title="Shared Inbox"
|
||||
description="Split layout untuk conversation list, timeline, assignment, notes, tags, dan reply composer."
|
||||
actions={<PlaceholderActions primaryHref="/team" primaryLabel="Manage team" secondaryHref="/contacts" secondaryLabel="Open contacts" />}
|
||||
>
|
||||
<InboxPlaceholder
|
||||
conversations={data.conversations}
|
||||
selectedConversation={data.selectedConversation}
|
||||
defaultPath={data.defaultPath}
|
||||
agents={data.agents}
|
||||
role={data.role}
|
||||
filter={data.filter}
|
||||
canSelfAssign={data.canSelfAssign}
|
||||
assignConversation={assignConversation}
|
||||
updateConversationStatus={updateConversationStatus}
|
||||
replyToConversation={replyToConversation}
|
||||
addConversationNote={addConversationNote}
|
||||
setConversationTags={setConversationTags}
|
||||
/>
|
||||
</ShellPage>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user