Skip to content
GitLab
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Register
Sign in
Toggle navigation
Menu
Paulo Avila
petruz-tasks
Commits
7a97aeb5
Commit
7a97aeb5
authored
Jul 10, 2026
by
Paulo Avila
Browse files
indicador de vencimento adicionado
parent
77642b28
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/components/tasks/subtask-overdue-badge.tsx
0 → 100644
View file @
7a97aeb5
import
{
AlertTriangle
}
from
"
lucide-react
"
;
import
type
{
Task
}
from
"
@/lib/data
"
;
import
{
getDueInfo
}
from
"
@/lib/dates
"
;
import
{
Badge
}
from
"
@/components/ui/badge
"
;
import
{
cn
}
from
"
@/lib/utils
"
;
/** Nº de subtarefas vencidas (não concluídas com previsão de término no passado). */
export
function
countOverdueSubtasks
(
subtasks
:
Task
[]):
number
{
return
subtasks
.
filter
(
(
s
)
=>
getDueInfo
(
s
.
DueDate
,
s
.
Status
)?.
state
===
"
overdue
"
).
length
;
}
/**
* Sinaliza na tarefa-mãe que ela possui subtarefas vencidas.
* `compact` mostra só o ícone + contagem (texto completo fica no tooltip).
*/
export
function
SubtaskOverdueBadge
({
subtasks
,
compact
=
false
,
className
,
}:
{
subtasks
:
Task
[];
compact
?:
boolean
;
className
?:
string
;
})
{
const
count
=
countOverdueSubtasks
(
subtasks
);
if
(
count
===
0
)
return
null
;
const
label
=
count
===
1
?
"
1 subtarefa vencida
"
:
`
${
count
}
subtarefas vencidas`
;
return
(
<
Badge
title
=
{
label
}
className
=
{
cn
(
"
gap-0.5 border-transparent bg-destructive px-1.5 py-0 text-[10px] font-medium leading-4 text-destructive-foreground hover:bg-destructive
"
,
className
)
}
>
<
AlertTriangle
className
=
"h-2.5 w-2.5 shrink-0"
/>
{
compact
?
count
:
label
}
</
Badge
>
);
}
src/components/tasks/task-board.tsx
View file @
7a97aeb5
...
@@ -8,6 +8,7 @@ import { Card, CardContent } from "@/components/ui/card";
...
@@ -8,6 +8,7 @@ import { Card, CardContent } from "@/components/ui/card";
import
{
Progress
}
from
"
@/components/ui/progress
"
;
import
{
Progress
}
from
"
@/components/ui/progress
"
;
import
{
DueBadge
}
from
"
./due-badge
"
;
import
{
DueBadge
}
from
"
./due-badge
"
;
import
{
PriorityBadge
}
from
"
./priority-badge
"
;
import
{
PriorityBadge
}
from
"
./priority-badge
"
;
import
{
SubtaskOverdueBadge
}
from
"
./subtask-overdue-badge
"
;
import
{
StatusBadge
}
from
"
./status-badge
"
;
import
{
StatusBadge
}
from
"
./status-badge
"
;
import
{
TaskDeleteButton
}
from
"
./task-delete-button
"
;
import
{
TaskDeleteButton
}
from
"
./task-delete-button
"
;
import
{
TaskDialog
}
from
"
./task-dialog
"
;
import
{
TaskDialog
}
from
"
./task-dialog
"
;
...
@@ -88,6 +89,10 @@ export function TaskBoard({
...
@@ -88,6 +89,10 @@ export function TaskBoard({
<
div
className
=
"flex flex-wrap items-center gap-1.5"
>
<
div
className
=
"flex flex-wrap items-center gap-1.5"
>
<
PriorityBadge
priority
=
{
task
.
Priority
}
/>
<
PriorityBadge
priority
=
{
task
.
Priority
}
/>
<
DueBadge
dueDate
=
{
task
.
DueDate
}
status
=
{
task
.
Status
}
/>
<
DueBadge
dueDate
=
{
task
.
DueDate
}
status
=
{
task
.
Status
}
/>
<
SubtaskOverdueBadge
subtasks
=
{
subtasksByTask
[
task
.
Id
]
??
[]
}
compact
/>
</
div
>
</
div
>
<
div
className
=
"flex items-center gap-2"
>
<
div
className
=
"flex items-center gap-2"
>
<
Progress
value
=
{
percent
}
className
=
"h-1.5"
/>
<
Progress
value
=
{
percent
}
className
=
"h-1.5"
/>
...
...
src/components/tasks/task-table.tsx
View file @
7a97aeb5
...
@@ -20,6 +20,7 @@ import {
...
@@ -20,6 +20,7 @@ import {
import
{
cn
}
from
"
@/lib/utils
"
;
import
{
cn
}
from
"
@/lib/utils
"
;
import
{
DueBadge
}
from
"
./due-badge
"
;
import
{
DueBadge
}
from
"
./due-badge
"
;
import
{
PriorityBadge
}
from
"
./priority-badge
"
;
import
{
PriorityBadge
}
from
"
./priority-badge
"
;
import
{
SubtaskOverdueBadge
}
from
"
./subtask-overdue-badge
"
;
import
{
StatusBadge
}
from
"
./status-badge
"
;
import
{
StatusBadge
}
from
"
./status-badge
"
;
import
{
TaskDeleteButton
}
from
"
./task-delete-button
"
;
import
{
TaskDeleteButton
}
from
"
./task-delete-button
"
;
import
{
TaskDialog
}
from
"
./task-dialog
"
;
import
{
TaskDialog
}
from
"
./task-dialog
"
;
...
@@ -204,6 +205,7 @@ export function TaskTable({
...
@@ -204,6 +205,7 @@ export function TaskTable({
{
task
.
Title
}
{
task
.
Title
}
</
span
>
</
span
>
<
PriorityBadge
priority
=
{
task
.
Priority
}
/>
<
PriorityBadge
priority
=
{
task
.
Priority
}
/>
<
SubtaskOverdueBadge
subtasks
=
{
subtasks
}
/>
</
div
>
</
div
>
{
task
.
Description
&&
(
{
task
.
Description
&&
(
<
p
className
=
"mt-0.5 text-xs text-muted-foreground"
>
<
p
className
=
"mt-0.5 text-xs text-muted-foreground"
>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment