@@ -2,7 +2,7 @@ import { Box, Card, CardContent, Chip, Link, Stack, Typography } from '@mui/mate
22import { Link as RouterLink } from 'react-router-dom' ;
33import { useTheme } from '@mui/system' ;
44import React from 'react' ;
5- import { Task , wbsPipe } from 'shared' ;
5+ import { Task , TaskCardPreview , wbsPipe } from 'shared' ;
66import LoadingIndicator from '../../../components/LoadingIndicator' ;
77import ErrorPage from '../../ErrorPage' ;
88import { useSingleProject } from '../../../hooks/projects.hooks' ;
@@ -14,15 +14,12 @@ import { taskPriorityColor } from '../../../utils/task.utils';
1414import { formatDate } from '../../../utils/datetime.utils' ;
1515
1616interface TeamTaskCardProps {
17- task : Task ;
17+ task : TaskCardPreview ;
1818 taskNumber : number ;
1919}
2020
2121const TeamTaskCard : React . FC < TeamTaskCardProps > = ( { task, taskNumber } ) => {
2222 const theme = useTheme ( ) ;
23- const { data : project , isLoading, isError, error } = useSingleProject ( task . wbsNum ) ;
24- if ( isLoading || ! project ) return < LoadingIndicator /> ;
25- if ( isError ) return < ErrorPage message = { error . message } /> ;
2623
2724 return (
2825 < Card
@@ -49,7 +46,7 @@ const TeamTaskCard: React.FC<TeamTaskCardProps> = ({ task, taskNumber }) => {
4946 </ Typography >
5047 < Link component = { RouterLink } to = { `${ routes . PROJECTS } /${ wbsPipe ( task . wbsNum ) } ` } noWrap >
5148 < Typography fontWeight = { 'regular' } variant = "subtitle2" >
52- { wbsPipe ( task . wbsNum ) } - { project . name }
49+ { wbsPipe ( task . wbsNum ) } - { task . projectName }
5350 </ Typography >
5451 </ Link >
5552 < Stack direction = { 'row' } spacing = { 1 } >
@@ -60,7 +57,7 @@ const TeamTaskCard: React.FC<TeamTaskCardProps> = ({ task, taskNumber }) => {
6057 < Stack spacing = { 1 } >
6158 < Chip
6259 sx = { {
63- background : taskPriorityColor ( task )
60+ background : taskPriorityColor ( { priority : task . priority } as Task )
6461 } }
6562 label = { task . priority }
6663 size = "medium"
0 commit comments