@@ -6,15 +6,41 @@ import { IconBell } from "@tabler/icons-react"
66import { Pie , PieChart } from "recharts"
77import { ChartContainer , type ChartConfig , ChartTooltip , ChartTooltipContent } from "@/components/ui/chart"
88import { ChartBarMultiple , type PlatformBarDatum } from "../components/chart-bar-multiple"
9+ import { Popover , PopoverContent , PopoverTrigger } from "@/components/ui/popover"
910import { ChartBarSingle } from "../components/chart-bar-single"
1011
1112export default function Page ( ) {
1213 const announcements = [
13- { id : "a1" , title : "Welcome to CampusReach Org Portal" , body : "Track sign-ups, manage events, and message students from one place." , date : "2025-09-15" } ,
14- { id : "a2" , title : "New: Opportunities Page" , body : "Create and manage opportunities with images, skills, and progress tracking." , date : "2025-09-20" } ,
15- { id : "a3" , title : "Reminder: Verify your profile" , body : "Add a logo and contact info so students recognize your org." , date : "2025-09-25" } ,
16- { id : "a4" , title : "Tip: Use Messaging" , body : "Reach out to interested students directly from the Messaging tab." , date : "2025-09-26" } ,
17- { id : "a5" , title : "Export Reports" , body : "Download monthly summaries of sign-ups and hours from the dashboard." , date : "2025-09-27" } ,
14+ {
15+ id : "a1" ,
16+ title : "New: Opportunities builder" ,
17+ body : "Create rich opportunities with images, required skills, and application questions. Drafts are auto‑saved." ,
18+ date : "2025-09-28" ,
19+ } ,
20+ {
21+ id : "a2" ,
22+ title : "Volunteer messaging launched" ,
23+ body : "Start 1:1 chats with interested volunteers from Opportunities and the Volunteers tab." ,
24+ date : "2025-10-01" ,
25+ } ,
26+ {
27+ id : "a3" ,
28+ title : "Ratings dashboard" ,
29+ body : "View event ratings distribution and comments to improve your next events." ,
30+ date : "2025-10-02" ,
31+ } ,
32+ {
33+ id : "a4" ,
34+ title : "CSV export" ,
35+ body : "Download monthly reports of sign‑ups and logged hours from the dashboard." ,
36+ date : "2025-10-03" ,
37+ } ,
38+ {
39+ id : "a5" ,
40+ title : "Maintenance window" ,
41+ body : "CampusReach will undergo scheduled maintenance on Oct 12, 1:00–1:30 AM ET. No downtime expected." ,
42+ date : "2025-10-05" ,
43+ } ,
1844 ]
1945
2046 // Active organization id
@@ -80,6 +106,9 @@ export default function Page() {
80106 { key : "four" , label : "4★" , value : ratingCounts [ 3 ] , fill : "var(--chart-4)" } ,
81107 { key : "five" , label : "5★" , value : ratingCounts [ 4 ] , fill : "var(--chart-5)" } ,
82108 ]
109+ const pieData = totalRatings === 0
110+ ? [ { key : "none" , label : "No ratings" , value : 1 , fill : "hsl(30 85% 48%)" } ]
111+ : ratingData
83112 const eventsFooter = React . useMemo ( ( ) => {
84113 const now = new Date ( )
85114 const start = new Date ( now )
@@ -141,9 +170,11 @@ export default function Page() {
141170 < div className = "flex items-center justify-between gap-4" >
142171 < ChartContainer config = { ratingChartConfig } className = "h-[120px] w-[120px]" >
143172 < PieChart >
144- < ChartTooltip cursor = { false } content = { < ChartTooltipContent hideLabel /> } />
173+ { totalRatings > 0 && (
174+ < ChartTooltip cursor = { false } content = { < ChartTooltipContent hideLabel /> } />
175+ ) }
145176 < Pie
146- data = { ratingData }
177+ data = { pieData }
147178 dataKey = "value"
148179 nameKey = "label"
149180 stroke = "0"
@@ -228,16 +259,29 @@ export default function Page() {
228259 </ div >
229260 < ul className = "divide-y" >
230261 { announcements . map ( ( a ) => (
231- < li key = { a . id } className = "flex items-start justify-between gap-4 p-3 hover:bg-muted/40" >
232- < div className = "min-w-0" >
233- < div className = "truncate font-medium" > { a . title } </ div >
234- < p className = "line-clamp-2 text-sm text-muted-foreground" > { a . body } </ p >
235- </ div >
236- < div className = "shrink-0" >
237- < span className = "rounded bg-muted px-2 py-0.5 text-xs text-muted-foreground" >
238- { new Date ( a . date ) . toLocaleDateString ( ) }
239- </ span >
240- </ div >
262+ < li key = { a . id } className = "p-0" >
263+ < Popover >
264+ < PopoverTrigger asChild >
265+ < button className = "w-full flex items-start justify-between gap-4 p-3 hover:bg-muted/40 text-left" >
266+ < div className = "min-w-0" >
267+ < div className = "truncate font-medium" > { a . title } </ div >
268+ < p className = "line-clamp-2 text-sm text-muted-foreground" > { a . body } </ p >
269+ </ div >
270+ < div className = "shrink-0" >
271+ < span className = "rounded bg-muted px-2 py-0.5 text-xs text-muted-foreground" >
272+ { new Date ( a . date ) . toLocaleDateString ( ) }
273+ </ span >
274+ </ div >
275+ </ button >
276+ </ PopoverTrigger >
277+ < PopoverContent className = "w-80" align = "end" >
278+ < div className = "space-y-1" >
279+ < div className = "text-sm font-medium" > { a . title } </ div >
280+ < div className = "text-[11px] text-muted-foreground" > { new Date ( a . date ) . toLocaleString ( ) } </ div >
281+ < p className = "text-sm text-foreground/80 whitespace-pre-wrap" > { a . body } </ p >
282+ </ div >
283+ </ PopoverContent >
284+ </ Popover >
241285 </ li >
242286 ) ) }
243287 </ ul >
0 commit comments