import { Activity, Building2, Package as PackageIcon, PowerOff, Snowflake, UserMinus, Users, Sparkles } from 'lucide-react';

export const bgColor = (title: string) => {
    const t = title.toLowerCase();
    const status =
        t.startsWith('active') || t === 'active' || t.includes('total contacts') || t.includes('active contacts')
            ? 'active'
            : t.startsWith('inactive') || t === 'inactive' || t.includes('inactive contacts') || t.includes('inactive packages')
              ? 'inactive'
              : t.startsWith('freezed') || t === 'freezed' || t.includes('linked contacts') || t.includes('invited')
                ? 'freezed'
                : t.startsWith('terminated') || t === 'terminated' || t.includes('deleted') || t.includes('unlinked')
                  ? 'terminated'
                  : t.includes('total tenants')
                    ? 'tenants'
                    : t.includes('total packages') || t.includes('active packages')
                      ? 'packages'
                      : t.includes('total features')
                        ? 'features'
                        : t.includes('pending jobs')
                          ? 'jobs'
                          : 'active';
    switch (status) {
        case 'active':
            return {
                bg: 'bg-green-100',
                icons: 'text-green-600',
                icon: Users,
            };
        case 'inactive':
            return {
                bg: 'bg-purple-100',
                icons: 'text-purple-600',
                icon: UserMinus,
            };
        case 'freezed':
            return {
                bg: 'bg-blue-100',
                icons: 'text-blue-600',
                icon: Snowflake,
            };
        case 'terminated':
            return {
                bg: 'bg-red-100',
                icons: 'text-red-600',
                icon: PowerOff,
            };
        case 'tenants':
            return {
                bg: 'bg-indigo-100',
                icons: 'text-indigo-600',
                icon: Building2,
            };
        case 'packages':
            return {
                bg: 'bg-emerald-100',
                icons: 'text-emerald-600',
                icon: PackageIcon,
            };
        case 'jobs':
            return {
                bg: 'bg-amber-100',
                icons: 'text-amber-600',
                icon: Activity,
            };
        case 'features':
            return {
                bg: 'bg-pink-100',
                icons: 'text-pink-600',
                icon: Sparkles,
            };
        default:
            return {
                bg: 'bg-gray-100',
                icons: 'text-gray-600',
                icon: Users,
            };
    }
};
