Refactor: Format badge text to normal case

This commit is contained in:
gpt-engineer-app[bot]
2025-10-28 13:12:20 +00:00
parent a6870b3acf
commit 1f44e7afcb

View File

@@ -33,6 +33,20 @@ const entityTypeColors = {
company: 'bg-indigo-500/10 text-indigo-700 dark:text-indigo-400 border-indigo-500/20',
};
const formatEntityType = (type: string): string => {
return type
.split('_')
.map(word => word.charAt(0).toUpperCase() + word.slice(1))
.join(' ');
};
const formatChangeType = (type: string): string => {
return type
.split('_')
.map(word => word.charAt(0).toUpperCase() + word.slice(1))
.join(' ');
};
export function RecentChangeCard({
entityType,
entityId,
@@ -78,10 +92,10 @@ export function RecentChangeCard({
<div className="space-y-2">
<div className="flex items-center gap-2 flex-wrap">
<Badge variant="outline" className={entityTypeColors[entityType]}>
{entityType}
{formatEntityType(entityType)}
</Badge>
<Badge variant="outline" className={changeTypeColors[changeType as keyof typeof changeTypeColors] || changeTypeColors.archived}>
{changeType}
{formatChangeType(changeType)}
</Badge>
</div>
<h3 className="font-bold line-clamp-2 text-sm group-hover:text-primary transition-all duration-300 group-hover:drop-shadow-[0_0_8px_rgba(139,92,246,0.5)]">{entityName}</h3>