mirror of
https://github.com/fsolla/teqo.git
synced 2026-11-17 04:23:07 +00:00
- Streaming AI endpoint at /campanha/api/ai-chat with DeepSeek V4 Flash - 8 tools: calculate, getMunicipalityVotes, getTopDeputies, getDobradinhas, getMunicipalityOverview, getLeaderships, getOrganizations, searchEntities - In-memory rate limiter (50 msgs / 15 min per user) - Desktop: resizable right sidebar via react-resizable-panels - Mobile: full-screen Drawer opened by FAB (2/3 size of quick-actions FAB) - Markdown rendering with react-markdown + remark-gfm (tables, bold, lists) - Session-bound context (clean slate each open) - Auth via existing campaign-token cookie, tools respect user RBAC - Architecture doc: docs/plans/ai-chat-sollinha.md - E2E tests: campaignAiChat.e2e.spec.ts (mocked endpoint)
34 lines
925 B
TypeScript
34 lines
925 B
TypeScript
'use client'
|
|
|
|
import type { ReactNode } from 'react'
|
|
|
|
import { CampaignGlobalSearchProvider } from '@/components/campaign/dashboard/CampaignGlobalSearchMount'
|
|
import {
|
|
CampaignContentScroll,
|
|
CampaignQuickActionsHost,
|
|
useQuickActionsChromeActive,
|
|
} from '@/components/campaign/shell/CampaignQuickActionsHost'
|
|
import type { CampaignRole } from '@/lib/campaignRoles'
|
|
|
|
export const CampaignAppScrollChrome = ({
|
|
role,
|
|
children,
|
|
}: {
|
|
role: CampaignRole
|
|
children: ReactNode
|
|
}) => {
|
|
const quickActionsActive = useQuickActionsChromeActive(role)
|
|
|
|
if (!quickActionsActive) {
|
|
return <CampaignContentScroll>{children}</CampaignContentScroll>
|
|
}
|
|
|
|
return (
|
|
<CampaignGlobalSearchProvider>
|
|
<div className="flex min-h-0 flex-1 flex-col">
|
|
<CampaignContentScroll>{children}</CampaignContentScroll>
|
|
<CampaignQuickActionsHost role={role} />
|
|
</div>
|
|
</CampaignGlobalSearchProvider>
|
|
)
|
|
}
|