Commit 77642b28 authored by Paulo Avila's avatar Paulo Avila
Browse files

mudança no badge de vencimento

parent 7c57e406
...@@ -27,9 +27,15 @@ export function DueBadge({ ...@@ -27,9 +27,15 @@ export function DueBadge({
: CalendarClock; : CalendarClock;
return ( return (
<Badge className={cn("gap-1", styles[info.state])}> <Badge
<Icon className="h-3 w-3" /> title={info.label}
{info.label} className={cn(
"gap-0.5 px-1.5 py-0 text-[10px] font-medium leading-4",
styles[info.state]
)}
>
<Icon className="h-2.5 w-2.5" />
{info.shortLabel}
</Badge> </Badge>
); );
} }
...@@ -165,7 +165,7 @@ export function TaskTable({ ...@@ -165,7 +165,7 @@ export function TaskTable({
<Fragment key={task.Id}> <Fragment key={task.Id}>
<TableRow <TableRow
className={cn( className={cn(
"group border-b transition-colors hover:bg-muted/30", "group border-b transition-colors hover:bg-muted/30 [&>td]:align-top",
isOpen ? "border-0 bg-muted/20" : "last:border-0" isOpen ? "border-0 bg-muted/20" : "last:border-0"
)} )}
> >
...@@ -254,21 +254,21 @@ export function TaskTable({ ...@@ -254,21 +254,21 @@ export function TaskTable({
<span className="text-sm text-muted-foreground"></span> <span className="text-sm text-muted-foreground"></span>
)} )}
</TableCell> </TableCell>
<TableCell className="py-3"> <TableCell className="py-3 align-top">
<span className="whitespace-nowrap text-sm text-muted-foreground"> <span className="block whitespace-nowrap text-sm leading-6 text-muted-foreground">
{formatDateShort(task.StartDate)} {formatDateShort(task.StartDate)}
</span> </span>
</TableCell> </TableCell>
<TableCell className="py-3"> <TableCell className="py-3 align-top">
<div className="flex items-center gap-2"> <div className="flex flex-col items-start gap-0.5">
<span className="whitespace-nowrap text-sm text-muted-foreground"> <span className="block whitespace-nowrap text-sm leading-6 text-muted-foreground">
{formatDateShort(task.DueDate)} {formatDateShort(task.DueDate)}
</span> </span>
<DueBadge dueDate={task.DueDate} status={task.Status} /> <DueBadge dueDate={task.DueDate} status={task.Status} />
</div> </div>
</TableCell> </TableCell>
<TableCell className="py-3"> <TableCell className="py-3 align-top">
<span className="whitespace-nowrap text-sm text-muted-foreground"> <span className="block whitespace-nowrap text-sm leading-6 text-muted-foreground">
{task.CompletedDate ? ( {task.CompletedDate ? (
<span className="text-green-600 dark:text-green-400"> <span className="text-green-600 dark:text-green-400">
{formatDateShort(task.CompletedDate)} {formatDateShort(task.CompletedDate)}
...@@ -383,7 +383,7 @@ export function TaskTable({ ...@@ -383,7 +383,7 @@ export function TaskTable({
Sem responsável Sem responsável
</span> </span>
)} )}
<div className="flex items-center gap-1.5"> <div className="flex flex-col items-start gap-0.5">
<span className="whitespace-nowrap text-xs text-muted-foreground"> <span className="whitespace-nowrap text-xs text-muted-foreground">
{sub.CompletedDate {sub.CompletedDate
? `✓ ${formatDateShort(sub.CompletedDate)}` ? `✓ ${formatDateShort(sub.CompletedDate)}`
......
...@@ -35,7 +35,10 @@ export type DueState = "overdue" | "today" | "soon" | "ok"; ...@@ -35,7 +35,10 @@ export type DueState = "overdue" | "today" | "soon" | "ok";
export interface DueInfo { export interface DueInfo {
state: DueState; state: DueState;
/** Texto completo (usado em tooltip). */
label: string; label: string;
/** Texto curto para o badge compacto ("Vencida", "Hoje", "2 dias"). */
shortLabel: string;
} }
/** Classifica o vencimento de uma tarefa para exibir alertas. */ /** Classifica o vencimento de uma tarefa para exibir alertas. */
...@@ -51,14 +54,17 @@ export function getDueInfo( ...@@ -51,14 +54,17 @@ export function getDueInfo(
return { return {
state: "overdue", state: "overdue",
label: days === -1 ? "Venceu ontem" : `Vencida há ${-days} dias`, label: days === -1 ? "Venceu ontem" : `Vencida há ${-days} dias`,
shortLabel: "Vencida",
}; };
} }
if (days === 0) return { state: "today", label: "Vence hoje" }; if (days === 0)
return { state: "today", label: "Vence hoje", shortLabel: "Hoje" };
if (days <= 3) { if (days <= 3) {
return { return {
state: "soon", state: "soon",
label: days === 1 ? "Vence amanhã" : `Vence em ${days} dias`, label: days === 1 ? "Vence amanhã" : `Vence em ${days} dias`,
shortLabel: days === 1 ? "Amanhã" : `${days} dias`,
}; };
} }
return { state: "ok", label: `Vence em ${days} dias` }; return { state: "ok", label: `Vence em ${days} dias`, shortLabel: `${days} dias` };
} }
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment