@@ -12,7 +12,6 @@ import {
1212 Pencil ,
1313 Settings ,
1414 FolderKanban ,
15- ListTodo ,
1615} from "lucide-react"
1716import { Button } from "@/components/ui/button"
1817import { buttonVariants } from "@/components/ui/button"
@@ -23,13 +22,9 @@ import {
2322 SettingsSection ,
2423} from "@/components/settings/settings-layout"
2524import {
26- PRIORITY_COLORS ,
2725 PROJECT_STATUS_COLORS ,
28- STATUS_COLORS ,
2926 TEAM_ROLE_COLORS ,
3027 type ColorTriad ,
31- type PriorityKey ,
32- type StatusKey ,
3328} from "@/lib/design-tokens"
3429import { Input } from "@/components/ui/input"
3530import { Label } from "@/components/ui/label"
@@ -78,24 +73,8 @@ const roleIcons = {
7873 member : User ,
7974}
8075
81- const taskStatusColorKeys : Record < string , StatusKey > = {
82- backlog : "todo" ,
83- completed : "done" ,
84- done : "done" ,
85- in_progress : "in_progress" ,
86- todo : "todo" ,
87- }
88-
8976const getBadgeColorClasses = ( colors : ColorTriad ) => cn ( colors . text , "bg-transparent border-linear-border" )
9077
91- interface Task {
92- id : string
93- title : string
94- status : string
95- priority : string
96- identifier : string | null
97- }
98-
9978export default function TeamDetailPage ( ) {
10079 return (
10180 < Suspense fallback = { null } >
@@ -117,8 +96,6 @@ function TeamDetailPageContent() {
11796 const [ teamColor , setTeamColor ] = useState ( "#10b981" )
11897 const [ isSavingTeam , setIsSavingTeam ] = useState ( false )
11998 const [ copiedInviteCode , setCopiedInviteCode ] = useState ( false )
120- const [ tasks , setTasks ] = useState < Task [ ] > ( [ ] )
121- const [ isLoadingTasks , setIsLoadingTasks ] = useState ( false )
12299 const [ isDeleteDialogOpen , setIsDeleteDialogOpen ] = useState ( false )
123100 const [ isDeleting , setIsDeleting ] = useState ( false )
124101 const [ removeMemberId , setRemoveMemberId ] = useState < string | null > ( null )
@@ -140,34 +117,14 @@ function TeamDetailPageContent() {
140117 }
141118 } , [ teamId ] )
142119
143- const loadTasks = useCallback ( async ( ) => {
144- if ( ! teamId ) return
145- try {
146- setIsLoadingTasks ( true )
147- const data = await apiFetch < { items : Task [ ] } | Task [ ] > ( `/api/tasks?teamId=${ teamId } ` )
148- setTasks ( Array . isArray ( data ) ? data : data . items )
149- } catch ( error ) {
150- console . error ( "Failed to fetch tasks:" , error )
151- if ( ! ( error instanceof ApiError && error . status === 401 ) ) {
152- toast . error ( error instanceof Error ? error . message : 'Failed to fetch tasks' )
153- }
154- } finally {
155- setIsLoadingTasks ( false )
156- }
157- } , [ teamId ] )
158-
159120 useEffect ( ( ) => {
160121 loadTeam ( )
161- loadTasks ( )
162- } , [ loadTeam , loadTasks ] )
122+ } , [ loadTeam ] )
163123
164124 useSSESubscription ( ( eventType ) => {
165125 if ( [ 'team:created' , 'team:updated' , 'team:deleted' ] . includes ( eventType ) ) {
166126 loadTeam ( )
167127 }
168- if ( [ 'task:created' , 'task:updated' , 'task:deleted' ] . includes ( eventType ) ) {
169- loadTasks ( )
170- }
171128 } )
172129
173130 const handleSaveTeamInfo = async ( e : React . FormEvent ) => {
@@ -255,15 +212,6 @@ function TeamDetailPageContent() {
255212 . slice ( 0 , 2 )
256213 }
257214
258- const getPriorityColor = ( priority : string ) => {
259- const key = priority . toLowerCase ( ) as PriorityKey
260- return getBadgeColorClasses ( PRIORITY_COLORS [ key ] ?? PRIORITY_COLORS . low )
261- }
262-
263- const getStatusColor = ( status : string ) => {
264- return getBadgeColorClasses ( STATUS_COLORS [ taskStatusColorKeys [ status . toLowerCase ( ) ] ?? "todo" ] )
265- }
266-
267215 const getProjectStatusColor = ( status : string ) => {
268216 const key = status as keyof typeof PROJECT_STATUS_COLORS
269217 return getBadgeColorClasses ( PROJECT_STATUS_COLORS [ key ] ?? PROJECT_STATUS_COLORS . planned )
@@ -500,68 +448,6 @@ function TeamDetailPageContent() {
500448 ) }
501449 </ SettingsSection >
502450
503- < SettingsSection
504- title = "Issues"
505- description = { `${ tasks . length } ${ tasks . length === 1 ? "issue" : "issues" } currently attached to this team` }
506- icon = { < ListTodo className = "h-4 w-4" /> }
507- >
508- < SettingsPanel className = "overflow-hidden" >
509- { isLoadingTasks ? (
510- < div className = "py-8 text-center text-linear-text-tertiary" > Loading issues...</ div >
511- ) : tasks . length > 0 ? (
512- < table className = "w-full" >
513- < thead >
514- < tr className = "border-b border-linear-border bg-linear-bg-tertiary/50" >
515- < th className = "text-left py-2 px-4 text-xs font-medium text-linear-text-tertiary uppercase tracking-wider" >
516- Title
517- </ th >
518- < th className = "text-left py-2 px-4 text-xs font-medium text-linear-text-tertiary uppercase tracking-wider w-[120px]" >
519- Status
520- </ th >
521- < th className = "text-left py-2 px-4 text-xs font-medium text-linear-text-tertiary uppercase tracking-wider w-[120px]" >
522- Priority
523- </ th >
524- </ tr >
525- </ thead >
526- < tbody >
527- { tasks . map ( ( task ) => (
528- < tr
529- key = { task . id }
530- className = "border-b border-linear-border/50 hover:bg-linear-bg-tertiary/30 transition-colors cursor-pointer"
531- onClick = { ( ) => router . push ( `/?teamId=${ teamId } ` ) }
532- >
533- < td className = "py-3 px-4" >
534- < div className = "flex items-center gap-2" >
535- { task . identifier && (
536- < span className = "text-xs font-mono text-linear-text-tertiary" > { task . identifier } </ span >
537- ) }
538- < span className = "text-sm text-linear-text truncate" > { task . title } </ span >
539- </ div >
540- </ td >
541- < td className = "py-3 px-4" >
542- < Badge variant = "outline" className = { cn ( getStatusColor ( task . status ) , "text-xs capitalize whitespace-nowrap" ) } >
543- { task . status . replace ( '_' , ' ' ) }
544- </ Badge >
545- </ td >
546- < td className = "py-3 px-4" >
547- < Badge variant = "outline" className = { cn ( getPriorityColor ( task . priority ) , "text-xs capitalize whitespace-nowrap" ) } >
548- { task . priority }
549- </ Badge >
550- </ td >
551- </ tr >
552- ) ) }
553- </ tbody >
554- </ table >
555- ) : (
556- < div className = "text-center py-8" >
557- < ListTodo className = "w-8 h-8 text-linear-text-tertiary mx-auto mb-2" />
558- < p className = "text-sm text-linear-text-secondary" > No issues yet</ p >
559- < p className = "text-xs text-linear-text-tertiary" > Issues assigned to this team will appear here</ p >
560- </ div >
561- ) }
562- </ SettingsPanel >
563- </ SettingsSection >
564-
565451 < SettingsSection
566452 title = "Parent project"
567453 description = "Teams now belong to one project. Use project settings for project-level access and lifecycle."
0 commit comments