Skip to content

Commit

Permalink
Update ReportDashboard.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
Arbyhisenaj committed Jan 6, 2025
1 parent 9f9e13a commit f2fa289
Showing 1 changed file with 46 additions and 33 deletions.
79 changes: 46 additions & 33 deletions nextjs/src/app/reports/[id]/dashboard/ReportDashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,23 @@ import {
import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs'
import { gql, useQuery } from '@apollo/client'
import { useAtom } from 'jotai'
import { CalendarIcon, FileIcon, MapPinIcon, UsersIcon } from 'lucide-react'
import {
CalendarIcon,
FileIcon,
MapPinIcon,
MessageSquareIcon,
UsersIcon,
} from 'lucide-react'
import { useReport } from '../(components)/ReportProvider'
import { TabTriggerClasses } from '../(components)/ReportSidebarLeft'
import { ConstituencyElectionDeepDive } from '../(components)/reportsConstituencyItem'
import { selectedBoundaryAtom } from '../useSelectBoundary'
import ReportDashboardChat from './ReportDashboardChat'
import ReportDashboardList from './ReportDashboardList'
import ReportDashboardMPs from './ReportDashboardMPs'
import ReportDashboardMemberCount from './ReportDashboardMemberCount'
import ReportDashboardMemberList from './ReportDashboardMemberList'
import ReportDashboardMembersOverTime from './ReportDashboardMembersOverTime'
import ReportMembers from './ReportMembers'

const IconClasses = 'w-4 h-4 stroke-meepGray-400 stroke-1 mr-1'

Expand Down Expand Up @@ -49,6 +56,11 @@ const dashboardTabItems = [
value: 'articles',
icon: <FileIcon className={IconClasses} />,
},
{
label: 'Chat',
value: 'chat',
icon: <MessageSquareIcon className={IconClasses} />,
},
]

export default function ReportDashboard() {
Expand Down Expand Up @@ -87,8 +99,10 @@ export default function ReportDashboard() {

return (
<main className="flex flex-col gap-4 w-full h-[calc(100vh-48px)] overflow-y-auto z-30">
<Tabs defaultValue="overview" className="col-span-4">
<TabsList className={TabTriggerClasses.tabsList}>
<Tabs defaultValue="overview" className="col-span-4 h-full">
<TabsList
className={`${TabTriggerClasses.tabsList} bg-meepGray-800 border-0`}
>
{dashboardTabItems.map((item) => (
<TabsTrigger
key={item.value}
Expand All @@ -102,35 +116,34 @@ export default function ReportDashboard() {
</TabsTrigger>
))}
</TabsList>
<div className="p-4">
<TabsContent value="overview">
<div className="flex flex-wrap gap-4 w-full">
{constituencies && !selectedBoundary && (
<>
<ReportDashboardMemberCount constituencies={constituencies} />
<ReportDashboardList constituencies={constituencies} />
<ReportDashboardMembersOverTime />
<ReportDashboardMPs constituencies={constituencies} />
</>
)}
{selectedBoundary && analyticalAreaType && (
<div className="col-span-full">
<ConstituencyElectionDeepDive
gss={selectedBoundary}
analyticalAreaType={analyticalAreaType}
/>
</div>
)}
</div>
</TabsContent>
<TabsContent value="members">
<ReportDashboardMemberList />
</TabsContent>
<TabsContent value="locations">Foodbanks Data goes here</TabsContent>
<TabsContent value="groups">Groups Data goes here</TabsContent>
<TabsContent value="events">Events Data goes here</TabsContent>
<TabsContent value="articles">Articles Data goes here</TabsContent>
</div>
<TabsContent value="overview" className="mt-0 p-4">
<div className="flex flex-wrap gap-4 w-full">
{constituencies && !selectedBoundary && (
<>
<ReportDashboardMemberCount constituencies={constituencies} />
<ReportDashboardList constituencies={constituencies} />
<ReportDashboardMembersOverTime />
<ReportDashboardMPs constituencies={constituencies} />
</>
)}
{selectedBoundary && analyticalAreaType && (
<ConstituencyElectionDeepDive
gss={selectedBoundary}
analyticalAreaType={analyticalAreaType}
/>
)}
</div>
</TabsContent>
<TabsContent value="members">
<ReportMembers />
</TabsContent>
<TabsContent value="locations">Foodbanks Data goes here</TabsContent>
<TabsContent value="groups">Groups Data goes here</TabsContent>
<TabsContent value="events">Events Data goes here</TabsContent>
<TabsContent value="articles">Articles Data goes here</TabsContent>
<TabsContent value="chat">
<ReportDashboardChat />
</TabsContent>
</Tabs>
</main>
)
Expand Down

0 comments on commit f2fa289

Please sign in to comment.