Edit/Delete/Start/Zeit-Buttons waren nur per group-hover sichtbar (opacity-0) und damit auf Touch-Geraeten unerreichbar. Jetzt mobil dauerhaft sichtbar, ab sm (Desktop) weiterhin Hover-Reveal. - TimelineSection (Bearbeiten/Loeschen einer Zeit-Zeile) - heute (Task starten/fortsetzen, Zeit nachtragen) - reflexion (ToDo-Titel bearbeiten) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
619 lines
21 KiB
TypeScript
619 lines
21 KiB
TypeScript
import { useState } from 'react';
|
||
import { useNavigate } from 'react-router';
|
||
import { trpc } from '../lib/trpc';
|
||
import { voice } from '../lib/voice';
|
||
import { Card } from '../components/ui/Card';
|
||
import { Button } from '../components/ui/Button';
|
||
import { Modal } from '../components/ui/Modal';
|
||
import { SkeletonCard } from '../components/ui/SkeletonCard';
|
||
import { toast } from 'sonner';
|
||
import { X, Plus, RotateCw, BellRing, Play, Clock, Check, LogOut } from 'lucide-react';
|
||
import { TimelineSection, ManualDialog } from '../components/time/TimelineSection';
|
||
import { formatDurationCompact } from '../lib/format-duration';
|
||
|
||
/** Aktuelle Stunde in Europe/Berlin (0–23). */
|
||
function berlinHourNow(): number {
|
||
const h = new Intl.DateTimeFormat('en-GB', {
|
||
timeZone: 'Europe/Berlin',
|
||
hour: '2-digit',
|
||
hour12: false,
|
||
}).format(new Date());
|
||
return parseInt(h, 10);
|
||
}
|
||
|
||
export function HeuteRoute() {
|
||
const navigate = useNavigate();
|
||
const today = trpc.dayEntry.today.useQuery();
|
||
|
||
if (today.isPending) return <SkeletonCard lines={4} />;
|
||
|
||
if (today.data?.entry) {
|
||
return <EinstempeltView todos={today.data.todos} entry={today.data.entry} />;
|
||
}
|
||
|
||
return <CheckInForm onDone={() => navigate('/dashboard')} />;
|
||
}
|
||
|
||
function CheckInForm({ onDone }: { onDone: () => void }) {
|
||
const carryQuery = trpc.dayEntry.pendingCarryOver.useQuery();
|
||
const [todos, setTodos] = useState<{ title: string; carried?: boolean }[]>([{ title: '' }]);
|
||
const [prefilledFromCarry, setPrefilledFromCarry] = useState(false);
|
||
|
||
// Wenn Carryover-ToDos geladen sind und das Formular noch leer ist, vorbefüllen.
|
||
if (
|
||
!prefilledFromCarry &&
|
||
carryQuery.data &&
|
||
carryQuery.data.length > 0 &&
|
||
todos.length === 1 &&
|
||
!todos[0]!.title
|
||
) {
|
||
setPrefilledFromCarry(true);
|
||
setTodos([...carryQuery.data.map((c) => ({ title: c.title, carried: true })), { title: '' }]);
|
||
}
|
||
|
||
const utils = trpc.useUtils();
|
||
const mutation = trpc.dayEntry.checkIn.useMutation({
|
||
onSuccess: async (result) => {
|
||
const msg =
|
||
result.carriedOver > 0
|
||
? `Locked in. ${result.carriedOver} offene ToDos vom Vortag übernommen.`
|
||
: voice.toast.checkedIn;
|
||
toast(msg);
|
||
await utils.dayEntry.today.invalidate();
|
||
await utils.dayEntry.pendingCarryOver.invalidate();
|
||
// Dashboard-Sichten sofort mitziehen (Quote, Anwesenheit, „Heute im Team").
|
||
await utils.dayEntry.todayTeam.invalidate();
|
||
await utils.dayEntry.todayPresence.invalidate();
|
||
await utils.dashboard.overview.invalidate();
|
||
onDone();
|
||
},
|
||
});
|
||
|
||
function updateAt(i: number, value: string) {
|
||
setTodos((arr) => arr.map((t, idx) => (idx === i ? { ...t, title: value } : t)));
|
||
}
|
||
|
||
function addRow() {
|
||
setTodos((arr) => [...arr, { title: '' }]);
|
||
}
|
||
|
||
function removeAt(i: number) {
|
||
setTodos((arr) => arr.filter((_, idx) => idx !== i));
|
||
}
|
||
|
||
function handleKey(e: React.KeyboardEvent<HTMLInputElement>, i: number) {
|
||
if (e.key === 'Enter') {
|
||
e.preventDefault();
|
||
if (i === todos.length - 1 && todos[i]?.title.trim()) {
|
||
addRow();
|
||
// Fokus auf neue Zeile in nächstem Tick
|
||
setTimeout(() => {
|
||
const inputs = document.querySelectorAll<HTMLInputElement>('input[data-todo-input]');
|
||
inputs[i + 1]?.focus();
|
||
}, 0);
|
||
}
|
||
}
|
||
}
|
||
|
||
function handleSubmit(e: React.FormEvent) {
|
||
e.preventDefault();
|
||
const filtered = todos.filter((t) => t.title.trim().length > 0);
|
||
if (filtered.length === 0) {
|
||
toast('Mindestens eine ToDo brauchst du.');
|
||
return;
|
||
}
|
||
mutation.mutate({ todos: filtered.map((t) => ({ title: t.title.trim() })) });
|
||
}
|
||
|
||
return (
|
||
<div className="mx-auto max-w-2xl space-y-6">
|
||
<header>
|
||
<h1 className="text-3xl font-bold">Heute</h1>
|
||
<p className="mt-1 text-[var(--color-ink-muted)]">{voice.hint.howIsItGoing}</p>
|
||
</header>
|
||
<Card.Root>
|
||
<form onSubmit={handleSubmit}>
|
||
<Card.Body className="space-y-3">
|
||
<p className="text-sm font-medium">Was nimmst du dir heute vor?</p>
|
||
{carryQuery.data && carryQuery.data.length > 0 && (
|
||
<p className="text-xs text-[var(--color-ink-muted)]">
|
||
<RotateCw size={12} className="inline -mt-0.5 mr-1" />
|
||
{carryQuery.data.length} offene ToDos vom Vortag wurden für dich vorgemerkt.
|
||
Behalte, ändere oder lösche sie.
|
||
</p>
|
||
)}
|
||
<ul className="space-y-2">
|
||
{todos.map((t, i) => (
|
||
<li key={i} className="flex items-center gap-2">
|
||
{t.carried && (
|
||
<span
|
||
className="inline-flex h-7 w-7 items-center justify-center rounded-full bg-black/5 text-[var(--color-ink-muted)]"
|
||
title="vom Vortag übernommen"
|
||
aria-label="vom Vortag übernommen"
|
||
>
|
||
<RotateCw size={12} />
|
||
</span>
|
||
)}
|
||
<input
|
||
type="text"
|
||
value={t.title}
|
||
onChange={(e) => updateAt(i, e.target.value)}
|
||
onKeyDown={(e) => handleKey(e, i)}
|
||
placeholder="ToDo …"
|
||
maxLength={200}
|
||
data-todo-input
|
||
ref={(el) => {
|
||
if (i === 0 && el && el.value === '') el.focus();
|
||
}}
|
||
className="flex-1 rounded-[var(--radius-md)] border border-[var(--color-border)] bg-white px-3 py-2 text-sm focus:border-[var(--color-ink)] focus:outline-none"
|
||
/>
|
||
{todos.length > 1 && (
|
||
<button
|
||
type="button"
|
||
onClick={() => removeAt(i)}
|
||
aria-label="ToDo entfernen"
|
||
className="rounded-[var(--radius-md)] p-2 text-[var(--color-ink-muted)] hover:bg-black/5"
|
||
>
|
||
<X size={16} />
|
||
</button>
|
||
)}
|
||
</li>
|
||
))}
|
||
</ul>
|
||
<button
|
||
type="button"
|
||
onClick={addRow}
|
||
className="inline-flex items-center gap-1 text-sm text-[var(--color-ink-muted)] hover:text-[var(--color-ink)]"
|
||
>
|
||
<Plus size={14} /> Weitere
|
||
</button>
|
||
</Card.Body>
|
||
<Card.Footer className="flex justify-end gap-2">
|
||
<Button variant="ghost" type="button" onClick={() => history.back()}>
|
||
Abbrechen
|
||
</Button>
|
||
<Button type="submit" disabled={mutation.isPending}>
|
||
{voice.cta.checkIn}
|
||
</Button>
|
||
</Card.Footer>
|
||
</form>
|
||
</Card.Root>
|
||
|
||
<TimelineSection />
|
||
</div>
|
||
);
|
||
}
|
||
|
||
function TodoRow({
|
||
todo,
|
||
allTodos,
|
||
}: {
|
||
todo: { id: string; title: string; status: 'open' | 'done' | 'dropped'; unplanned?: boolean };
|
||
allTodos: Array<{ id: string; title: string }>;
|
||
}) {
|
||
const utils = trpc.useUtils();
|
||
const now = trpc.time.now.useQuery();
|
||
const [retroOpen, setRetroOpen] = useState(false);
|
||
const startMutation = trpc.time.start.useMutation({
|
||
onSuccess: async () => {
|
||
await utils.time.now.invalidate();
|
||
await utils.time.listToday.invalidate();
|
||
},
|
||
});
|
||
const stopMutation = trpc.time.stop.useMutation({
|
||
onSuccess: async () => {
|
||
await utils.time.now.invalidate();
|
||
await utils.time.listToday.invalidate();
|
||
},
|
||
});
|
||
const activeHere = now.data?.find((a) => a.todoId === todo.id);
|
||
const isRunningHere = !!activeHere;
|
||
const dotClass =
|
||
todo.status === 'done'
|
||
? 'h-2 w-2 rounded-full bg-[var(--color-ampel-green-fg)]'
|
||
: todo.status === 'dropped'
|
||
? 'h-2 w-2 rounded-full bg-[var(--color-ink-faint)]'
|
||
: 'h-2 w-2 rounded-full bg-[var(--color-border-strong)]';
|
||
return (
|
||
<li className="group flex items-center gap-2">
|
||
<span className={dotClass} />
|
||
<span
|
||
className={
|
||
todo.status === 'dropped' ? 'flex-1 line-through text-[var(--color-ink-muted)]' : 'flex-1'
|
||
}
|
||
>
|
||
{todo.title}
|
||
{todo.unplanned && (
|
||
<span className="ml-2 rounded-full bg-black/5 px-1.5 py-0.5 text-[10px] text-[var(--color-ink-muted)]">
|
||
ungeplant
|
||
</span>
|
||
)}
|
||
</span>
|
||
{todo.status !== 'done' && todo.status !== 'dropped' && (
|
||
<button
|
||
type="button"
|
||
onClick={() =>
|
||
activeHere
|
||
? stopMutation.mutate({ id: activeHere.id })
|
||
: startMutation.mutate({ todoId: todo.id, category: 'focus' })
|
||
}
|
||
aria-label={isRunningHere ? 'Task pausieren' : 'Task starten / fortsetzen'}
|
||
title={isRunningHere ? 'Pausieren' : 'Starten / fortsetzen'}
|
||
className={
|
||
isRunningHere
|
||
? 'inline-flex h-7 items-center gap-1 rounded-full bg-[var(--color-ampel-red-bg)] px-2 text-xs font-medium text-[var(--color-ampel-red-fg)]'
|
||
: 'inline-flex h-7 w-7 items-center justify-center rounded-full text-[var(--color-ink-muted)] opacity-100 hover:bg-black/5 hover:text-[var(--color-ink)] sm:opacity-0 sm:group-hover:opacity-100'
|
||
}
|
||
>
|
||
{isRunningHere ? (
|
||
<>
|
||
<span className="relative flex h-1.5 w-1.5 items-center justify-center">
|
||
<span className="absolute h-1.5 w-1.5 animate-ping rounded-full bg-current opacity-60" />
|
||
<span className="relative h-1.5 w-1.5 rounded-full bg-current" />
|
||
</span>
|
||
läuft
|
||
</>
|
||
) : (
|
||
<Play size={12} fill="currentColor" />
|
||
)}
|
||
</button>
|
||
)}
|
||
{todo.status !== 'done' && todo.status !== 'dropped' && !isRunningHere && (
|
||
<button
|
||
type="button"
|
||
onClick={() => setRetroOpen(true)}
|
||
aria-label="Zeit nachtragen"
|
||
title="Zeit nachtragen"
|
||
className="inline-flex h-7 w-7 items-center justify-center rounded-full text-[var(--color-ink-muted)] opacity-100 hover:bg-black/5 hover:text-[var(--color-ink)] sm:opacity-0 sm:group-hover:opacity-100"
|
||
>
|
||
<Clock size={12} />
|
||
</button>
|
||
)}
|
||
{retroOpen && (
|
||
<ManualDialog
|
||
todos={allTodos}
|
||
defaultTodoId={todo.id}
|
||
onClose={() => setRetroOpen(false)}
|
||
/>
|
||
)}
|
||
</li>
|
||
);
|
||
}
|
||
|
||
function AddTodoInline() {
|
||
const utils = trpc.useUtils();
|
||
const [title, setTitle] = useState('');
|
||
const add = trpc.dayEntry.addTodo.useMutation({
|
||
onSuccess: async () => {
|
||
setTitle('');
|
||
await utils.dayEntry.today.invalidate();
|
||
await utils.dayEntry.todayTeam.invalidate();
|
||
await utils.dashboard.overview.invalidate();
|
||
},
|
||
});
|
||
return (
|
||
<form
|
||
className="mt-3 flex items-center gap-2"
|
||
onSubmit={(e) => {
|
||
e.preventDefault();
|
||
const v = title.trim();
|
||
if (!v) return;
|
||
add.mutate({ title: v });
|
||
}}
|
||
>
|
||
<input
|
||
type="text"
|
||
value={title}
|
||
onChange={(e) => setTitle(e.target.value)}
|
||
placeholder="Neues ToDo hinzufügen …"
|
||
maxLength={200}
|
||
className="flex-1 rounded-[var(--radius-md)] border border-[var(--color-border)] bg-white px-3 py-2 text-sm focus:border-[var(--color-ink)] focus:outline-none"
|
||
/>
|
||
<Button type="submit" size="sm" variant="secondary" disabled={!title.trim() || add.isPending}>
|
||
<Plus size={14} /> Hinzufügen
|
||
</Button>
|
||
</form>
|
||
);
|
||
}
|
||
|
||
function CheckInOutBar({
|
||
checkedInAt,
|
||
checkedOutAt,
|
||
todos,
|
||
reflected,
|
||
}: {
|
||
checkedInAt: string | Date | null;
|
||
checkedOutAt: string | Date | null;
|
||
todos: Array<{ id: string; title: string; status: 'open' | 'done' | 'dropped' }>;
|
||
reflected: boolean;
|
||
}) {
|
||
const utils = trpc.useUtils();
|
||
const [confirmOpen, setConfirmOpen] = useState(false);
|
||
const checkOut = trpc.dayEntry.checkOut.useMutation({
|
||
onSuccess: async () => {
|
||
setConfirmOpen(false);
|
||
toast('Feierabend — Check-Out gespeichert.');
|
||
await utils.dayEntry.today.invalidate();
|
||
await utils.dashboard.overview.invalidate();
|
||
},
|
||
});
|
||
const reopen = trpc.dayEntry.reopen.useMutation({
|
||
onSuccess: async () => {
|
||
toast('Willkommen zurück — Arbeit fortgesetzt.');
|
||
await utils.dayEntry.today.invalidate();
|
||
await utils.dashboard.overview.invalidate();
|
||
},
|
||
onError: (err) => toast(err.message),
|
||
});
|
||
const hhmm = (d: string | Date | null) =>
|
||
d
|
||
? new Intl.DateTimeFormat('de-DE', {
|
||
timeZone: 'Europe/Berlin',
|
||
hour: '2-digit',
|
||
minute: '2-digit',
|
||
}).format(new Date(d))
|
||
: '—';
|
||
const duration =
|
||
checkedInAt && checkedOutAt
|
||
? formatDurationCompact(
|
||
Math.max(
|
||
0,
|
||
Math.round((new Date(checkedOutAt).getTime() - new Date(checkedInAt).getTime()) / 1000),
|
||
),
|
||
)
|
||
: null;
|
||
|
||
return (
|
||
<>
|
||
<div className="flex flex-wrap items-center gap-x-3 gap-y-1 rounded-[var(--radius-md)] border border-[var(--color-border)] px-4 py-2 text-sm">
|
||
<span>
|
||
Arbeitsantritt <span className="font-mono">{hhmm(checkedInAt)}</span>
|
||
</span>
|
||
{checkedOutAt ? (
|
||
<>
|
||
<span className="text-[var(--color-ink-muted)]">
|
||
· Feierabend <span className="font-mono">{hhmm(checkedOutAt)}</span>
|
||
{duration && ` · ${duration}`}
|
||
</span>
|
||
<Button
|
||
size="sm"
|
||
variant="ghost"
|
||
className="ml-auto"
|
||
disabled={reopen.isPending}
|
||
onClick={() => reopen.mutate()}
|
||
>
|
||
<Play size={14} /> Arbeit fortsetzen
|
||
</Button>
|
||
</>
|
||
) : (
|
||
<Button
|
||
size="sm"
|
||
variant="secondary"
|
||
className="ml-auto"
|
||
onClick={() => setConfirmOpen(true)}
|
||
>
|
||
<LogOut size={14} /> Feierabend / Check-Out
|
||
</Button>
|
||
)}
|
||
</div>
|
||
<FeierabendDialog
|
||
open={confirmOpen}
|
||
onClose={() => setConfirmOpen(false)}
|
||
todos={todos}
|
||
reflected={reflected}
|
||
pending={checkOut.isPending}
|
||
onConfirm={() => checkOut.mutate()}
|
||
/>
|
||
</>
|
||
);
|
||
}
|
||
|
||
/**
|
||
* Tagesabschluss vor dem Feierabend: kurze Zusammenfassung (erledigt/offen/
|
||
* verworfen) und ein Hinweis, falls noch ToDos offen oder die Reflexion fehlt.
|
||
* Feierabend ist reversibel ("Arbeit fortsetzen") — der Dialog ist daher Info,
|
||
* keine harte Sperre.
|
||
*/
|
||
function FeierabendDialog({
|
||
open,
|
||
onClose,
|
||
todos,
|
||
reflected,
|
||
pending,
|
||
onConfirm,
|
||
}: {
|
||
open: boolean;
|
||
onClose: () => void;
|
||
todos: Array<{ id: string; title: string; status: 'open' | 'done' | 'dropped' }>;
|
||
reflected: boolean;
|
||
pending: boolean;
|
||
onConfirm: () => void;
|
||
}) {
|
||
const navigate = useNavigate();
|
||
const done = todos.filter((t) => t.status === 'done');
|
||
const dropped = todos.filter((t) => t.status === 'dropped');
|
||
const offen = todos.filter((t) => t.status === 'open');
|
||
const reflexionEmpfohlen = !reflected || offen.length > 0;
|
||
|
||
return (
|
||
<Modal open={open} onClose={onClose} title="Feierabend?" size="md">
|
||
<p className="mt-1 text-sm text-[var(--color-ink-muted)]">
|
||
Kurzer Blick auf den Tag, bevor du abschließt.
|
||
</p>
|
||
|
||
<div className="mt-4 flex flex-wrap gap-x-4 gap-y-1 text-sm">
|
||
<span>
|
||
<strong>{done.length}</strong> erledigt
|
||
</span>
|
||
<span>
|
||
<strong>{offen.length}</strong> offen
|
||
</span>
|
||
{dropped.length > 0 && (
|
||
<span>
|
||
<strong>{dropped.length}</strong> verworfen
|
||
</span>
|
||
)}
|
||
</div>
|
||
|
||
{done.length > 0 && (
|
||
<ul className="mt-3 space-y-1 text-sm">
|
||
{done.map((t) => (
|
||
<li key={t.id} className="flex items-center gap-2 text-[var(--color-ink-muted)]">
|
||
<Check size={14} className="shrink-0 text-[var(--color-ampel-green-fg)]" />
|
||
<span className="truncate">{t.title}</span>
|
||
</li>
|
||
))}
|
||
</ul>
|
||
)}
|
||
|
||
{offen.length > 0 && (
|
||
<div className="mt-4 rounded-[var(--radius-md)] border border-[var(--color-ampel-amber-fg)] bg-[var(--color-ampel-amber-bg)] px-3 py-2 text-sm">
|
||
<strong className="block">Noch offen — nicht reflektiert:</strong>
|
||
<ul className="mt-1 space-y-0.5">
|
||
{offen.map((t) => (
|
||
<li key={t.id} className="truncate">
|
||
· {t.title}
|
||
</li>
|
||
))}
|
||
</ul>
|
||
</div>
|
||
)}
|
||
|
||
{!reflected && (
|
||
<p className="mt-3 text-sm text-[var(--color-ink-muted)]">
|
||
Du hast heute noch nicht reflektiert.
|
||
</p>
|
||
)}
|
||
|
||
<div className="mt-5 flex flex-wrap justify-end gap-2">
|
||
<Button variant="ghost" onClick={onClose}>
|
||
Abbrechen
|
||
</Button>
|
||
{reflexionEmpfohlen && (
|
||
<Button variant="secondary" onClick={() => navigate('/reflexion')}>
|
||
Zur Reflexion
|
||
</Button>
|
||
)}
|
||
<Button variant="primary" disabled={pending} onClick={onConfirm}>
|
||
Tag abschließen
|
||
</Button>
|
||
</div>
|
||
</Modal>
|
||
);
|
||
}
|
||
|
||
function AddUnplannedInline() {
|
||
const utils = trpc.useUtils();
|
||
const [title, setTitle] = useState('');
|
||
const add = trpc.dayEntry.addUnplanned.useMutation({
|
||
onSuccess: async () => {
|
||
setTitle('');
|
||
toast('Ungeplant erledigt — eingetragen.');
|
||
await utils.dayEntry.today.invalidate();
|
||
await utils.dayEntry.todayTeam.invalidate();
|
||
await utils.dashboard.overview.invalidate();
|
||
},
|
||
});
|
||
return (
|
||
<form
|
||
className="mt-2 flex items-center gap-2"
|
||
onSubmit={(e) => {
|
||
e.preventDefault();
|
||
const v = title.trim();
|
||
if (!v) return;
|
||
add.mutate({ title: v });
|
||
}}
|
||
>
|
||
<input
|
||
type="text"
|
||
value={title}
|
||
onChange={(e) => setTitle(e.target.value)}
|
||
placeholder="Ungeplant erledigt? z. B. mItapp-Security-Fix für Yevgen …"
|
||
maxLength={200}
|
||
className="flex-1 rounded-[var(--radius-md)] border border-dashed border-[var(--color-border)] bg-white px-3 py-2 text-sm focus:border-[var(--color-ink)] focus:outline-none"
|
||
/>
|
||
<Button type="submit" size="sm" variant="ghost" disabled={!title.trim() || add.isPending}>
|
||
<Check size={14} /> Erledigt eintragen
|
||
</Button>
|
||
</form>
|
||
);
|
||
}
|
||
|
||
function EinstempeltView({
|
||
todos,
|
||
entry,
|
||
}: {
|
||
todos: Array<{
|
||
id: string;
|
||
title: string;
|
||
status: 'open' | 'done' | 'dropped';
|
||
unplanned?: boolean;
|
||
}>;
|
||
entry: {
|
||
status: 'begun' | 'full' | 'absent';
|
||
checkedInAt: string | Date | null;
|
||
checkedOutAt: string | Date | null;
|
||
};
|
||
}) {
|
||
// Reflexion ist „fällig", wenn nach 18:00 Berlin und noch nicht abgeschlossen.
|
||
const reflectionDue = entry.status !== 'full' && berlinHourNow() >= 18;
|
||
// CTA bleibt den ganzen Tag sichtbar — der Eintrag ist bis 00:00 (Berlin) änderbar.
|
||
const ctaLabel = entry.status === 'full' ? 'Reflexion aktualisieren' : voice.cta.reflect;
|
||
const subtitle =
|
||
entry.status === 'full'
|
||
? 'Tag abgeschlossen. Bis Mitternacht (Berlin) noch änderbar.'
|
||
: 'Locked in. Heute Abend reflektieren.';
|
||
|
||
return (
|
||
<div className="mx-auto max-w-2xl space-y-6">
|
||
<header>
|
||
<h1 className="text-3xl font-bold">Heute</h1>
|
||
<p className="mt-1 text-[var(--color-ink-muted)]">{subtitle}</p>
|
||
</header>
|
||
|
||
<CheckInOutBar
|
||
checkedInAt={entry.checkedInAt}
|
||
checkedOutAt={entry.checkedOutAt}
|
||
todos={todos}
|
||
reflected={entry.status === 'full'}
|
||
/>
|
||
|
||
{reflectionDue && (
|
||
<div
|
||
role="alert"
|
||
className="flex items-start gap-3 rounded-md border border-[var(--color-ampel-amber-fg)] bg-[var(--color-ampel-amber-bg)] px-4 py-3 text-sm text-[var(--color-ink)]"
|
||
>
|
||
<BellRing
|
||
className="mt-0.5 h-5 w-5 shrink-0 text-[var(--color-ampel-amber-fg)]"
|
||
aria-hidden="true"
|
||
/>
|
||
<div className="flex-1">
|
||
<strong className="block">Reflexion fällig</strong>
|
||
<span className="text-[var(--color-ink-muted)]">
|
||
Es ist nach 18:00 — schließ den Tag noch ab.
|
||
</span>
|
||
</div>
|
||
<Button onClick={() => (location.href = '/reflexion')}>Jetzt reflektieren</Button>
|
||
</div>
|
||
)}
|
||
|
||
<Card.Root>
|
||
<Card.Body>
|
||
<ul className="space-y-2 text-sm">
|
||
{todos.map((t) => (
|
||
<TodoRow key={t.id} todo={t} allTodos={todos} />
|
||
))}
|
||
</ul>
|
||
<AddTodoInline />
|
||
<AddUnplannedInline />
|
||
</Card.Body>
|
||
<Card.Footer className="flex justify-end">
|
||
<Button onClick={() => (location.href = '/reflexion')}>{ctaLabel}</Button>
|
||
</Card.Footer>
|
||
</Card.Root>
|
||
|
||
<TimelineSection />
|
||
</div>
|
||
);
|
||
}
|