11import type { Icon } from "@phosphor-icons/react" ;
2- import {
3- type SituationColor ,
4- situationCss ,
5- } from "@posthog/ui/features/home/utils/situationDisplay" ;
62import { ScrollArea } from "@radix-ui/themes" ;
73import type { ReactNode } from "react" ;
84
5+ export type WorkBoardColor =
6+ | "red"
7+ | "orange"
8+ | "amber"
9+ | "green"
10+ | "blue"
11+ | "purple"
12+ | "gray" ;
13+
914export interface WorkBoardColumn < T > {
1015 id : string ;
1116 label : string ;
1217 description : string ;
13- color : SituationColor ;
18+ color : WorkBoardColor ;
1419 Icon : Icon ;
1520 items : T [ ] ;
1621}
1722
23+ function columnColors ( color : WorkBoardColor ) {
24+ return {
25+ foreground : `var(--${ color } -11)` ,
26+ tint : `var(--${ color } -a3)` ,
27+ wash : `var(--${ color } -a2)` ,
28+ } ;
29+ }
30+
1831export function WorkBoard < T > ( {
1932 columns,
2033 getKey,
@@ -29,7 +42,7 @@ export function WorkBoard<T>({
2942 return (
3043 < div className = "flex h-full min-h-0 gap-3 overflow-x-auto p-4" >
3144 { columns . map ( ( column ) => {
32- const c = situationCss ( column . color ) ;
45+ const colors = columnColors ( column . color ) ;
3346 const count = column . items . length ;
3447 return (
3548 < div
@@ -40,22 +53,25 @@ export function WorkBoard<T>({
4053 className = "mb-2 flex items-center gap-2 px-1"
4154 title = { column . description }
4255 >
43- < span style = { { color : c . fg } } >
56+ < span style = { { color : colors . foreground } } >
4457 < column . Icon size = { 14 } weight = "bold" />
4558 </ span >
4659 < span className = "font-semibold text-[12px] text-gray-12" >
4760 { column . label }
4861 </ span >
4962 < span
5063 className = "rounded-full px-1.5 py-px font-semibold text-[10.5px] tabular-nums"
51- style = { { color : c . fg , backgroundColor : c . tint } }
64+ style = { {
65+ color : colors . foreground ,
66+ backgroundColor : colors . tint ,
67+ } }
5268 >
5369 { count }
5470 </ span >
5571 </ div >
5672 < div
5773 className = "min-h-0 flex-1 rounded-xl border border-(--gray-3)"
58- style = { { backgroundColor : c . wash } }
74+ style = { { backgroundColor : colors . wash } }
5975 >
6076 < ScrollArea scrollbars = "vertical" className = "h-full min-h-0" >
6177 < div className = "flex flex-col gap-2 p-2" >
@@ -85,7 +101,7 @@ export function WorkBoard<T>({
85101function WorkBoardCardSkeleton ( ) {
86102 return (
87103 < output
88- aria-label = "Loading tasks "
104+ aria-label = "Loading items "
89105 className = "flex h-[112px] animate-pulse flex-col gap-3 rounded-lg border border-(--gray-4) bg-(--color-panel-solid) p-3"
90106 >
91107 < div className = "h-3 w-4/5 rounded bg-(--gray-5)" />
0 commit comments