mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-23 14:51:13 -05:00
Refactor: Format badge text to normal case
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user