mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-23 16:11:12 -05:00
Refactor moderation data fetching
This commit is contained in:
@@ -10,7 +10,8 @@ interface RichCompanyDisplayProps {
|
||||
}
|
||||
|
||||
export function RichCompanyDisplay({ data, actionType, showAllFields = true }: RichCompanyDisplayProps) {
|
||||
const getCompanyTypeColor = (type: string) => {
|
||||
const getCompanyTypeColor = (type: string | undefined) => {
|
||||
if (!type) return 'bg-gray-500';
|
||||
switch (type.toLowerCase()) {
|
||||
case 'manufacturer': return 'bg-blue-500';
|
||||
case 'operator': return 'bg-green-500';
|
||||
@@ -31,7 +32,7 @@ export function RichCompanyDisplay({ data, actionType, showAllFields = true }: R
|
||||
<h3 className="text-xl font-bold text-foreground truncate">{data.name}</h3>
|
||||
<div className="flex items-center gap-2 mt-1 flex-wrap">
|
||||
<Badge className={`${getCompanyTypeColor(data.company_type)} text-white text-xs`}>
|
||||
{data.company_type?.replace(/_/g, ' ').replace(/\b\w/g, l => l.toUpperCase())}
|
||||
{(data.company_type || 'Unknown')?.replace(/_/g, ' ').replace(/\b\w/g, l => l.toUpperCase())}
|
||||
</Badge>
|
||||
{data.person_type && (
|
||||
<Badge variant="outline" className="text-xs">
|
||||
|
||||
Reference in New Issue
Block a user