Display task labels with their associated colors on task cards

Update ProjectTemplate.tsx to use a typed query for labels. Update TaskCard.tsx to fetch labels and display the color-coded label associated with each task.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: ceced2fc-aa46-458d-ba87-ddd4b7bb1518
Replit-Commit-Checkpoint-Type: intermediate_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/659922a9-0087-461c-90dd-6d9a58b81d4d/ceced2fc-aa46-458d-ba87-ddd4b7bb1518/XrG8SoT
This commit is contained in:
paul-nothaft
2025-09-11 12:00:36 +00:00
parent 87cc2b3885
commit 5f866afbb1
2 changed files with 19 additions and 16 deletions
+2 -2
View File
@@ -88,7 +88,7 @@ export default function ProjectTemplate({
const queryClient = useQueryClient();
// Fetch labels
const { data: labels = [], isLoading: labelsLoading } = useQuery({
const { data: labels = [], isLoading: labelsLoading } = useQuery<Label[]>({
queryKey: ['/api/labels'],
});
@@ -470,7 +470,7 @@ export default function ProjectTemplate({
</div>
) : (
<div className="grid gap-3 sm:grid-cols-2 lg:grid-cols-3">
{labels.map((label: Label) => (
{labels.map((label) => (
<Card
key={label.id}
className="p-4 hover-elevate active-elevate-2"