@@ -2,10 +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' ;
6- import LoadingIndicator from '../../../components/LoadingIndicator' ;
7- import ErrorPage from '../../ErrorPage' ;
8- import { useSingleProject } from '../../../hooks/projects.hooks' ;
5+ import { Task , TaskCardPreview , wbsPipe } from 'shared' ;
96import { routes } from '../../../utils/routes' ;
107import { fullNamePipe } from '../../../utils/pipes' ;
118import PeopleAltIcon from '@mui/icons-material/PeopleAlt' ;
@@ -14,15 +11,12 @@ import { taskPriorityColor } from '../../../utils/task.utils';
1411import { formatDate } from '../../../utils/datetime.utils' ;
1512
1613interface TeamTaskCardProps {
17- task : Task ;
14+ task : TaskCardPreview ;
1815 taskNumber : number ;
1916}
2017
2118const TeamTaskCard : React . FC < TeamTaskCardProps > = ( { task, taskNumber } ) => {
2219 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 } /> ;
2620
2721 return (
2822 < Card
@@ -49,7 +43,7 @@ const TeamTaskCard: React.FC<TeamTaskCardProps> = ({ task, taskNumber }) => {
4943 </ Typography >
5044 < Link component = { RouterLink } to = { `${ routes . PROJECTS } /${ wbsPipe ( task . wbsNum ) } ` } noWrap >
5145 < Typography fontWeight = { 'regular' } variant = "subtitle2" >
52- { wbsPipe ( task . wbsNum ) } - { project . name }
46+ { wbsPipe ( task . wbsNum ) } - { task . projectName }
5347 </ Typography >
5448 </ Link >
5549 < Stack direction = { 'row' } spacing = { 1 } >
@@ -60,7 +54,7 @@ const TeamTaskCard: React.FC<TeamTaskCardProps> = ({ task, taskNumber }) => {
6054 < Stack spacing = { 1 } >
6155 < Chip
6256 sx = { {
63- background : taskPriorityColor ( task )
57+ background : taskPriorityColor ( { priority : task . priority } as Task )
6458 } }
6559 label = { task . priority }
6660 size = "medium"
0 commit comments