Fix upcoming widget row alignment with consistent priority column

The priority badge was conditionally rendered, causing rows without
priority to have fewer flex children and shifting the date/type columns.
Now always renders a fixed-width priority slot (invisible when empty).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Kyle 2026-02-21 12:36:35 +08:00
parent e74d4cf7c6
commit 7d4089762e

View File

@ -56,16 +56,15 @@ export default function UpcomingWidget({ items, days = 7 }: UpcomingWidgetProps)
<span className={cn('text-[9px] font-semibold uppercase tracking-wider shrink-0 w-14 text-right', config.color)}> <span className={cn('text-[9px] font-semibold uppercase tracking-wider shrink-0 w-14 text-right', config.color)}>
{config.label} {config.label}
</span> </span>
{item.priority && (
<span className={cn( <span className={cn(
'text-[9px] font-semibold px-1.5 py-0.5 rounded shrink-0', 'text-[9px] font-semibold px-1.5 py-0.5 rounded shrink-0 w-10 text-center',
item.priority === 'high' ? 'bg-red-500/10 text-red-400' : item.priority === 'high' ? 'bg-red-500/10 text-red-400' :
item.priority === 'medium' ? 'bg-yellow-500/10 text-yellow-400' : item.priority === 'medium' ? 'bg-yellow-500/10 text-yellow-400' :
'bg-green-500/10 text-green-400' item.priority === 'low' ? 'bg-green-500/10 text-green-400' :
'invisible'
)}> )}>
{item.priority} {item.priority || ''}
</span> </span>
)}
</div> </div>
); );
})} })}