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:
48
app/agent/inbox/page.tsx
Normal file
48
app/agent/inbox/page.tsx
Normal file
@ -0,0 +1,48 @@
|
||||
import { InboxPlaceholder } from "@/components/placeholders";
|
||||
import { 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 AgentInboxPage({
|
||||
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: "agent",
|
||||
conversationId: params?.conversationId,
|
||||
filter
|
||||
});
|
||||
|
||||
return (
|
||||
<ShellPage shell="agent" title="My Inbox" description="Assigned conversations, notes, tags, dan reply composer versi agent.">
|
||||
<InboxPlaceholder
|
||||
conversations={data.conversations}
|
||||
selectedConversation={data.selectedConversation}
|
||||
defaultPath={data.defaultPath}
|
||||
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