Fix TS build errors: guard optional remind_at, add none priority to TodoItem
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
80f3f3ed10
commit
a144945077
@ -57,7 +57,7 @@ export default function ReminderList({ reminders, onEdit }: ReminderListProps) {
|
|||||||
return (
|
return (
|
||||||
<div className="grid gap-4 md:grid-cols-2 lg:grid-cols-3">
|
<div className="grid gap-4 md:grid-cols-2 lg:grid-cols-3">
|
||||||
{reminders.map((reminder) => {
|
{reminders.map((reminder) => {
|
||||||
const isOverdue = !reminder.is_dismissed && isPast(new Date(reminder.remind_at));
|
const isOverdue = !reminder.is_dismissed && !!reminder.remind_at && isPast(new Date(reminder.remind_at));
|
||||||
return (
|
return (
|
||||||
<Card
|
<Card
|
||||||
key={reminder.id}
|
key={reminder.id}
|
||||||
@ -85,7 +85,7 @@ export default function ReminderList({ reminders, onEdit }: ReminderListProps) {
|
|||||||
)}
|
)}
|
||||||
<div className="flex items-center gap-2 text-sm text-muted-foreground mb-3">
|
<div className="flex items-center gap-2 text-sm text-muted-foreground mb-3">
|
||||||
<Calendar className="h-4 w-4" />
|
<Calendar className="h-4 w-4" />
|
||||||
{format(new Date(reminder.remind_at), 'MMM d, yyyy h:mm a')}
|
{reminder.remind_at ? format(new Date(reminder.remind_at), 'MMM d, yyyy h:mm a') : 'No date set'}
|
||||||
{isOverdue && <span className="text-destructive font-medium">(Overdue)</span>}
|
{isOverdue && <span className="text-destructive font-medium">(Overdue)</span>}
|
||||||
</div>
|
</div>
|
||||||
<div className="flex gap-2" onClick={(e) => e.stopPropagation()}>
|
<div className="flex gap-2" onClick={(e) => e.stopPropagation()}>
|
||||||
|
|||||||
@ -14,7 +14,8 @@ interface TodoItemProps {
|
|||||||
onEdit: (todo: Todo) => void;
|
onEdit: (todo: Todo) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
const priorityColors = {
|
const priorityColors: Record<string, string> = {
|
||||||
|
none: 'bg-gray-500/10 text-gray-400 border-gray-500/20',
|
||||||
low: 'bg-green-500/10 text-green-500 border-green-500/20',
|
low: 'bg-green-500/10 text-green-500 border-green-500/20',
|
||||||
medium: 'bg-yellow-500/10 text-yellow-500 border-yellow-500/20',
|
medium: 'bg-yellow-500/10 text-yellow-500 border-yellow-500/20',
|
||||||
high: 'bg-red-500/10 text-red-500 border-red-500/20',
|
high: 'bg-red-500/10 text-red-500 border-red-500/20',
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user