This commit is contained in:
Stefan ATZLESBERGER
2026-04-16 16:30:29 +02:00
parent c2b20a9f10
commit e5f77debc2
3 changed files with 14 additions and 15 deletions
+7 -9
View File
@@ -155,15 +155,6 @@ export function SnippetCard({ snippet, treeColorByName, treeDisplayByName, onRep
<div className="snippet-md overflow-auto" dangerouslySetInnerHTML={{ __html: viewHtml }} />
</div>
</div>
{snippet.deadline_at ? (
<div className="border-t border-border/70 pt-1.5">
<SnippetDeadlineBadge
deadlineAt={snippet.deadline_at}
busy={busy}
onMarkDone={() => void clearDeadlineRemote()}
/>
</div>
) : null}
</CardContent>
<CardFooter className="flex flex-row flex-wrap items-center gap-2 border-t border-border/80 px-3 py-1">
<div className="flex min-h-7 min-w-0 flex-1 flex-wrap items-center gap-1">
@@ -181,6 +172,13 @@ export function SnippetCard({ snippet, treeColorByName, treeDisplayByName, onRep
)}
</div>
<div className="flex h-7 shrink-0 items-center gap-1.5">
{snippet.deadline_at ? (
<SnippetDeadlineBadge
deadlineAt={snippet.deadline_at}
busy={busy}
onMarkDone={() => void clearDeadlineRemote()}
/>
) : null}
<span className="whitespace-nowrap text-[10px] leading-none tabular-nums text-muted-foreground/90">
{formatWhen(snippet.updated_at)}
</span>
@@ -12,10 +12,10 @@ type Props = {
export function SnippetDeadlineBadge({ deadlineAt, busy, onMarkDone }: Props) {
const tone = deadlineTone(deadlineAt);
return (
<div className="flex items-center gap-0.5">
<div className="contents">
<span
className={cn(
"inline-flex max-w-full items-center rounded-md border-2 px-2 py-px text-[10px] font-medium tabular-nums leading-tight",
"text-[10px] font-medium tabular-nums",
deadlineBadgeClass(tone),
)}
title="Deadline"
@@ -27,11 +27,12 @@ export function SnippetDeadlineBadge({ deadlineAt, busy, onMarkDone }: Props) {
type="button"
variant="ghost"
size="icon-sm"
className="size-7 shrink-0 text-muted-foreground hover:text-foreground"
className="size-7 text-muted-foreground hover:text-foreground"
disabled={busy}
title="Erledigt — Deadline entfernen"
onClick={e => {
e.stopPropagation();
onMarkDone();
}}
>
+3 -3
View File
@@ -32,11 +32,11 @@ export function deadlineTone(deadlineAt: string | null | undefined): DeadlineTon
export function deadlineBadgeClass(tone: DeadlineTone): string {
switch (tone) {
case "upcoming":
return "border-blue-500/70 bg-blue-500/10 text-blue-800 dark:text-blue-200";
return "text-blue-500/70 text-blue-800 dark:text-blue-200";
case "today":
return "border-orange-500/80 bg-orange-500/15 text-orange-900 dark:text-orange-100";
return "text-orange-500/80 text-orange-900 dark:text-orange-100";
case "overdue":
return "border-destructive/80 bg-destructive/10 text-destructive";
return "text-destructive/80 text-destructive";
default:
return "";
}