mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-23 16:51:14 -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',
|
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({
|
export function RecentChangeCard({
|
||||||
entityType,
|
entityType,
|
||||||
entityId,
|
entityId,
|
||||||
@@ -78,10 +92,10 @@ export function RecentChangeCard({
|
|||||||
<div className="space-y-2">
|
<div className="space-y-2">
|
||||||
<div className="flex items-center gap-2 flex-wrap">
|
<div className="flex items-center gap-2 flex-wrap">
|
||||||
<Badge variant="outline" className={entityTypeColors[entityType]}>
|
<Badge variant="outline" className={entityTypeColors[entityType]}>
|
||||||
{entityType}
|
{formatEntityType(entityType)}
|
||||||
</Badge>
|
</Badge>
|
||||||
<Badge variant="outline" className={changeTypeColors[changeType as keyof typeof changeTypeColors] || changeTypeColors.archived}>
|
<Badge variant="outline" className={changeTypeColors[changeType as keyof typeof changeTypeColors] || changeTypeColors.archived}>
|
||||||
{changeType}
|
{formatChangeType(changeType)}
|
||||||
</Badge>
|
</Badge>
|
||||||
</div>
|
</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>
|
<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