import {
  FaArchive,
  FaArrowCircleDown,
  FaArrowDown,
  FaArrowUp,
  FaAward,
  FaBan,
  FaBolt,
  FaBox,
  FaBullseye,
  FaCalendar,
  FaCheck,
  FaCheckCircle,
  FaClock,
  FaCog,
  FaComment,
  FaEdit,
  FaEnvelope,
  FaExclamationCircle,
  FaExclamationTriangle,
  FaEye,
  FaFileAlt,
  FaFileInvoiceDollar,
  FaFlask,
  FaIndustry,
  FaLock,
  FaMapMarkerAlt,
  FaMedal,
  FaPause,
  FaPhone,
  FaPlay,
  FaPlus,
  FaStar,
  FaTimesCircle,
  FaTrophy,
  FaTruck,
  FaUser,
  FaUsers,
  FaUserTie,
  FaVideo,
  FaWrench,
} from 'react-icons/fa'
import {
  ApprovalStatusEnum,
  MmDeliveryItem,
  MaterialTypeEnum,
  MovementStatusEnum,
  MovementTypeEnum,
  OrderStatusEnum,
  QualityStatusEnum,
  QuotationStatusEnum,
  RequestStatusEnum,
  RequisitionStatusEnum,
  SerialStatusEnum,
  SupplierCardTypeEnum,
  SupplierTypeEnum,
  ReceiptStatusEnum,
} from '../types/mm'
import {
  BOMTypeEnum,
  OperationCategoryEnum,
  MrpProductionOrder,
  ProductionOrderStatusEnum,
  ProductionOrderTypeEnum,
  RecommendationStatusEnum,
  RequirementSourceTypeEnum,
  RoutingStatusEnum,
  SecurityLevelEnum,
  ForecastMethodEnum,
} from '../types/mrp'
import { FaRepeat } from 'react-icons/fa6'
import { ApprovalLevelEnum, DeliveryStatusEnum, RequestTypeEnum } from '../types/mm'
import {
  ConditionOperatorEnum,
  ConditionTypeEnum,
  CountStatusEnum,
  CountTypeEnum,
  LocationTypeEnum,
  PutawayStrategyEnum,
  StockStatusEnum,
  WarehouseTypeEnum,
  ZoneTypeEnum,
} from '../types/wm'
import {
  BusinessPartyIndustryEnum,
  BusinessPartyStatusEnum,
  PaymentTerms,
  PriorityEnum,
  TeamRoleEnum,
} from '../types/common'
import {
  AccountTypeEnum,
  BankAccountTypeEnum,
  BankTransactionTypeEnum,
  CashMovementTypeEnum,
  CheckStatusEnum,
  TypeEnum,
  FiDocumentTypeEnum,
  InvoiceStatusEnum,
  InvoiceTypeEnum,
  NoteStatusEnum,
  PaymentMethodEnum,
  PaymentStatusEnum,
  RiskGroupEnum,
  TransactionStatusEnum,
  WaybillStatusEnum,
  WaybillTypeEnum,
} from '../types/fi'
import {
  ActivityStatusEnum,
  CrmActivityTypeEnum,
  CustomerSegmentEnum,
  CustomerTypeEnum,
  LostReasonCategoryEnum,
  OpportunityStageEnum,
  SaleOrderItemStatusEnum,
  SaleOrderStatusEnum,
} from '../types/crm'
import {
  AssessorTypeEnum,
  CampaignStatusEnum,
  CostCenterType,
  EmployeeStatusEnum,
  EmploymentTypeEnum,
  GenderEnum,
  JobLevelEnum,
  LeaveStatusEnum,
  LeaveTypeEnum,
  MaritalStatusEnum,
  ParticipantStatusEnum,
  PayrollStatusEnum,
} from '../types/hr'
import {
  CriticalityLevelEnum,
  FaultTypeEnum,
  FrequencyUnitEnum,
  MaintenancePlanTypeEnum,
  NotificationStatusEnum,
  WorkCenterStatusEnum,
  WorkOrderStatusEnum,
  WorkOrderTypeEnum,
} from '../types/pm'
import {
  DailyUpdateStatusEnum,
  PhaseCategoryEnum,
  PhaseStatusEnum,
  ProjectCostTrackingStatus,
  ProjectStatusEnum,
  ProjectTypeEnum,
  PsActivityTypeEnum,
  PsDocumentTypeEnum,
  RiskCategoryEnum,
  RiskImpactEnum,
  RiskLevelEnum,
  RiskProbabilityEnum,
  RiskStatusEnum,
  TaskStatusEnum,
  TaskTypeEnum,
  WorkTypeEnum,
} from '../types/ps'

export const getBOMTypeText = (type: BOMTypeEnum) => {
  switch (type) {
    case BOMTypeEnum.Production:
      return 'Üretim'
    case BOMTypeEnum.Engineering:
      return 'Mühendislik'
    case BOMTypeEnum.Planning:
      return 'Planlama'
    case BOMTypeEnum.Costing:
      return 'Maliyetleme'
    default:
      return 'Bilinmiyor'
  }
}

export const getBOMTypeColor = (type: BOMTypeEnum) => {
  switch (type) {
    case BOMTypeEnum.Production:
      return 'bg-blue-100 text-blue-800'
    case BOMTypeEnum.Engineering:
      return 'bg-green-100 text-green-800'
    case BOMTypeEnum.Planning:
      return 'bg-yellow-100 text-yellow-800'
    case BOMTypeEnum.Costing:
      return 'bg-purple-100 text-purple-800'
    default:
      return 'bg-gray-100 text-gray-800'
  }
}

export const getMovementTypeText = (type: MovementTypeEnum) => {
  switch (type) {
    case MovementTypeEnum.GoodsReceipt:
      return 'Mal Girişi'
    case MovementTypeEnum.GoodsIssue:
      return 'Mal Çıkışı'
    case MovementTypeEnum.Transfer:
      return 'Transfer'
    default:
      return 'Bilinmeyen'
  }
}

export const getMovementTypeIcon = (type: MovementTypeEnum) => {
  switch (type) {
    case MovementTypeEnum.GoodsReceipt:
      return FaArrowUp
    case MovementTypeEnum.GoodsIssue:
      return FaArrowDown
    case MovementTypeEnum.Transfer:
      return FaRepeat
    default:
      return FaArchive
  }
}

export const getMovementTypeColor = (type: MovementTypeEnum) => {
  switch (type) {
    case MovementTypeEnum.GoodsReceipt:
      return 'text-green-600 bg-green-100'
    case MovementTypeEnum.GoodsIssue:
      return 'text-red-600 bg-red-100'
    case MovementTypeEnum.Transfer:
      return 'text-blue-600 bg-blue-100'
    default:
      return 'text-gray-600 bg-gray-100'
  }
}

export const getMovementTypeSign = (type: MovementTypeEnum) => {
  switch (type) {
    case MovementTypeEnum.GoodsReceipt:
      return '+'
    case MovementTypeEnum.GoodsIssue:
      return '-'
    case MovementTypeEnum.Transfer:
      return ''
    default:
      return ''
  }
}

export const getMaterialTypeText = (code: MaterialTypeEnum) => {
  switch (code) {
    case MaterialTypeEnum.RawMaterial:
      return 'HAMMADDE'
    case MaterialTypeEnum.SemiFinished:
      return 'YARI_MAMUL'
    case MaterialTypeEnum.Finished:
      return 'MAMUL'
    case MaterialTypeEnum.Consumable:
      return 'SARF_MALZ'
    case MaterialTypeEnum.Service:
      return 'HIZMET'
    case MaterialTypeEnum.Spare:
      return 'YEDEK_PARCA'
    default:
      return code
  }
}

export const getOperationTypeText = (type: OperationCategoryEnum) => {
  const types = {
    [OperationCategoryEnum.Production]: 'Üretim',
    [OperationCategoryEnum.Assembly]: 'Montaj',
    [OperationCategoryEnum.Inspection]: 'Kalite Kontrolü',
    [OperationCategoryEnum.Packaging]: 'Paketleme',
    [OperationCategoryEnum.Setup]: 'Hazırlık',
    [OperationCategoryEnum.Maintenance]: 'Bakım',
    [OperationCategoryEnum.Transport]: 'Taşıma',
    [OperationCategoryEnum.Quality]: 'Kalite',
  }
  return types[type]
}

export const getOperationTypeColor = (type: OperationCategoryEnum) => {
  const colors = {
    [OperationCategoryEnum.Production]: 'bg-blue-100 text-blue-800',
    [OperationCategoryEnum.Assembly]: 'bg-green-100 text-green-800',
    [OperationCategoryEnum.Inspection]: 'bg-purple-100 text-purple-800',
    [OperationCategoryEnum.Packaging]: 'bg-orange-100 text-orange-800',
    [OperationCategoryEnum.Setup]: 'bg-yellow-100 text-yellow-800',
    [OperationCategoryEnum.Maintenance]: 'bg-red-100 text-red-800',
    [OperationCategoryEnum.Transport]: 'bg-indigo-100 text-indigo-800',
    [OperationCategoryEnum.Quality]: 'bg-pink-100 text-pink-800',
  }
  return colors[type]
}

export const getSkillLevelText = (level: number) => {
  const levels = ['Başlangıç', 'Temel', 'Orta', 'İleri', 'Uzman']
  return levels[level - 1] || 'Belirsiz'
}

export const getWarehouseTypeText = (type: WarehouseTypeEnum) => {
  const types = {
    [WarehouseTypeEnum.RawMaterials]: 'Hammadde',
    [WarehouseTypeEnum.FinishedGoods]: 'Mamul',
    [WarehouseTypeEnum.WorkInProgress]: 'Ara Ürün',
    [WarehouseTypeEnum.Quarantine]: 'Karantina',
    [WarehouseTypeEnum.Returns]: 'İade',
    [WarehouseTypeEnum.Transit]: 'Transit',
    [WarehouseTypeEnum.SpareParts]: 'Parçalı',
  }
  return types[type]
}

export const getWarehouseTypeColor = (type: WarehouseTypeEnum) => {
  const colors = {
    [WarehouseTypeEnum.RawMaterials]: 'bg-blue-100 text-blue-800',
    [WarehouseTypeEnum.FinishedGoods]: 'bg-green-100 text-green-800',
    [WarehouseTypeEnum.WorkInProgress]: 'bg-yellow-100 text-yellow-800',
    [WarehouseTypeEnum.SpareParts]: 'bg-purple-100 text-purple-800',
    [WarehouseTypeEnum.Quarantine]: 'bg-red-100 text-red-800',
    [WarehouseTypeEnum.Returns]: 'bg-pink-100 text-pink-800',
    [WarehouseTypeEnum.Transit]: 'bg-indigo-100 text-indigo-800',
  }
  return colors[type]
}

export const getRoutingStatusText = (status: RoutingStatusEnum) => {
  const statuses = {
    [RoutingStatusEnum.Draft]: 'Taslak',
    [RoutingStatusEnum.Active]: 'Aktif',
    [RoutingStatusEnum.Inactive]: 'Pasif',
    [RoutingStatusEnum.Obsolete]: 'Eski Sürüm',
  }
  return statuses[status]
}

export const getRoutingStatusColor = (status: RoutingStatusEnum) => {
  const colors = {
    [RoutingStatusEnum.Draft]: 'bg-yellow-100 text-yellow-800',
    [RoutingStatusEnum.Active]: 'bg-green-100 text-green-800',
    [RoutingStatusEnum.Inactive]: 'bg-gray-100 text-gray-800',
    [RoutingStatusEnum.Obsolete]: 'bg-red-100 text-red-800',
  }
  return colors[status]
}

export const getRequestTypeText = (type: RequestTypeEnum) => {
  const types = {
    [RequestTypeEnum.Material]: 'Malzeme',
    [RequestTypeEnum.Service]: 'Hizmet',
    [RequestTypeEnum.WorkCenter]: 'İş Merkezi',
    [RequestTypeEnum.Maintenance]: 'Bakım',
  }
  return types[type]
}

export const getRequestTypeColor = (type: RequestTypeEnum) => {
  const colors = {
    [RequestTypeEnum.Material]: 'bg-blue-100 text-blue-800',
    [RequestTypeEnum.Service]: 'bg-green-100 text-green-800',
    [RequestTypeEnum.WorkCenter]: 'bg-purple-100 text-purple-800',
    [RequestTypeEnum.Maintenance]: 'bg-orange-100 text-orange-800',
  }
  return colors[type]
}

export const getApprovalLevelText = (level: ApprovalLevelEnum) => {
  const levels = {
    [ApprovalLevelEnum.Supervisor]: 'Süpervizör',
    [ApprovalLevelEnum.Manager]: 'Yönetici',
    [ApprovalLevelEnum.Director]: 'Direktör',
    [ApprovalLevelEnum.GeneralManager]: 'Genel Müdür',
    [ApprovalLevelEnum.FinanceManager]: 'Mali İşler Müdürü',
    [ApprovalLevelEnum.TechnicalManager]: 'Teknik Müdür',
  }
  return levels[level]
}

export const getApprovalLevelColor = (level: ApprovalLevelEnum) => {
  const colors = {
    [ApprovalLevelEnum.Supervisor]: 'bg-gray-100 text-gray-800',
    [ApprovalLevelEnum.Manager]: 'bg-blue-100 text-blue-800',
    [ApprovalLevelEnum.Director]: 'bg-purple-100 text-purple-800',
    [ApprovalLevelEnum.GeneralManager]: 'bg-red-100 text-red-800',
    [ApprovalLevelEnum.FinanceManager]: 'bg-green-100 text-green-800',
    [ApprovalLevelEnum.TechnicalManager]: 'bg-orange-100 text-orange-800',
  }
  return colors[level]
}

export const getDeliveryStatusText = (status: DeliveryStatusEnum) => {
  const statuses = {
    [DeliveryStatusEnum.Preparing]: 'Hazırlanıyor',
    [DeliveryStatusEnum.Shipped]: 'Kargoya Verildi',
    [DeliveryStatusEnum.InTransit]: 'Yolda',
    [DeliveryStatusEnum.OutForDelivery]: 'Dağıtımda',
    [DeliveryStatusEnum.Delivered]: 'Teslim Edildi',
    [DeliveryStatusEnum.PartiallyDelivered]: 'Kısmi Teslim',
    [DeliveryStatusEnum.Delayed]: 'Gecikmeli',
    [DeliveryStatusEnum.Returned]: 'İade Edildi',
    [DeliveryStatusEnum.Cancelled]: 'İptal Edildi',
  }
  return statuses[status]
}

export const getPriorityText = (priority: PriorityEnum) => {
  const priorities = {
    [PriorityEnum.Low]: 'Düşük',
    [PriorityEnum.Normal]: 'Normal',
    [PriorityEnum.High]: 'Yüksek',
    [PriorityEnum.Urgent]: 'Acil',
  }
  return priorities[priority]
}

export const getPriorityColor = (priority: PriorityEnum) => {
  const colors = {
    [PriorityEnum.Low]: 'bg-emerald-50 text-emerald-700 border-emerald-200',
    [PriorityEnum.Normal]: 'bg-blue-50 text-blue-700 border-blue-200',
    [PriorityEnum.High]: 'bg-orange-50 text-orange-700 border-orange-200',
    [PriorityEnum.Urgent]: 'bg-red-50 text-red-700 border-red-200',
  }
  return colors[priority]
}

export const getWaybillStatusText = (status: WaybillStatusEnum) => {
  switch (status) {
    case WaybillStatusEnum.Draft:
      return 'Taslak'
    case WaybillStatusEnum.Confirmed:
      return 'Onaylandı'
    case WaybillStatusEnum.Delivered:
      return 'Teslim Edildi'
    case WaybillStatusEnum.Cancelled:
      return 'İptal'
    default:
      return 'Bilinmiyor'
  }
}

export const getWaybillStatusColor = (status: WaybillStatusEnum) => {
  switch (status) {
    case WaybillStatusEnum.Draft:
      return 'bg-gray-100 text-gray-800'
    case WaybillStatusEnum.Confirmed:
      return 'bg-blue-100 text-blue-800'
    case WaybillStatusEnum.Delivered:
      return 'bg-green-100 text-green-800'
    case WaybillStatusEnum.Cancelled:
      return 'bg-red-100 text-red-800'
    default:
      return 'bg-gray-100 text-gray-800'
  }
}

export const getWaybillTypeText = (type: WaybillTypeEnum) => {
  switch (type) {
    case WaybillTypeEnum.Outgoing:
      return 'Çıkış İrsaliyesi'
    case WaybillTypeEnum.Incoming:
      return 'Giriş İrsaliyesi'
    case WaybillTypeEnum.Transfer:
      return 'Transfer İrsaliyesi'
    case WaybillTypeEnum.Return:
      return 'İade İrsaliyesi'
    default:
      return 'Bilinmiyor'
  }
}

export const getBusinessPartyStatusText = (status: BusinessPartyStatusEnum) => {
  switch (status) {
    case BusinessPartyStatusEnum.Prospect:
      return 'Potansiyel'
    case BusinessPartyStatusEnum.Active:
      return 'Aktif'
    case BusinessPartyStatusEnum.Inactive:
      return 'Pasif'
    case BusinessPartyStatusEnum.Blocked:
      return 'Blokeli'
    default:
      return 'Bilinmiyor'
  }
}

export const getBusinessPartyStatusColor = (status: BusinessPartyStatusEnum) => {
  switch (status) {
    case BusinessPartyStatusEnum.Prospect:
      return 'bg-blue-100 text-blue-800 border-blue-200'
    case BusinessPartyStatusEnum.Active:
      return 'bg-green-100 text-green-800 border-green-200'
    case BusinessPartyStatusEnum.Inactive:
      return 'bg-gray-100 text-gray-800 border-gray-200'
    case BusinessPartyStatusEnum.Blocked:
      return 'bg-red-100 text-red-800 border-red-200'
    default:
      return 'bg-gray-100 text-gray-800 border-gray-200'
  }
}

export const getCustomerSegmentColor = (segment: CustomerSegmentEnum) => {
  switch (segment) {
    case CustomerSegmentEnum.Enterprise:
      return 'text-purple-600'
    case CustomerSegmentEnum.SMB:
      return 'text-blue-600'
    case CustomerSegmentEnum.Startup:
      return 'text-green-600'
    case CustomerSegmentEnum.Government:
      return 'text-orange-600'
    default:
      return 'text-gray-600'
  }
}

export const getCustomerSegmentText = (segment: CustomerSegmentEnum) => {
  switch (segment) {
    case CustomerSegmentEnum.Enterprise:
      return 'Kurumsal'
    case CustomerSegmentEnum.SMB:
      return 'KOBİ'
    case CustomerSegmentEnum.Startup:
      return 'Girişim'
    case CustomerSegmentEnum.Government:
      return 'Kamu'
    default:
      return 'Diğer'
  }
}

export const getLostReasonCategoryText = (category: LostReasonCategoryEnum) => {
  const categoryLabels = {
    [LostReasonCategoryEnum.Price]: 'Fiyat',
    [LostReasonCategoryEnum.Product]: 'Ürün',
    [LostReasonCategoryEnum.Service]: 'Hizmet',
    [LostReasonCategoryEnum.Competitor]: 'Rekabet',
    [LostReasonCategoryEnum.Timing]: 'Zamanlama',
    [LostReasonCategoryEnum.Budget]: 'Bütçe',
  }
  return categoryLabels[category]
}

export const getLostReasonCategoryColor = (category: LostReasonCategoryEnum) => {
  const categoryColors = {
    [LostReasonCategoryEnum.Price]: 'bg-red-100 text-red-800',
    [LostReasonCategoryEnum.Product]: 'bg-blue-100 text-blue-800',
    [LostReasonCategoryEnum.Service]: 'bg-green-100 text-green-800',
    [LostReasonCategoryEnum.Competitor]: 'bg-purple-100 text-purple-800',
    [LostReasonCategoryEnum.Timing]: 'bg-yellow-100 text-yellow-800',
    [LostReasonCategoryEnum.Budget]: 'bg-orange-100 text-orange-800',
  }
  return categoryColors[category]
}

export const getActivityTypeText = (type: CrmActivityTypeEnum) => {
  const typeLabels = {
    [CrmActivityTypeEnum.Call]: 'Telefon Görüşmesi',
    [CrmActivityTypeEnum.Email]: 'E-posta',
    [CrmActivityTypeEnum.Meeting]: 'Toplantı',
    [CrmActivityTypeEnum.Task]: 'Görev',
    [CrmActivityTypeEnum.Note]: 'Not',
    [CrmActivityTypeEnum.Demo]: 'Demo',
    [CrmActivityTypeEnum.Proposal]: 'Teklif',
  }
  return typeLabels[type]
}

export const getActivityTypeIcon = (type: CrmActivityTypeEnum) => {
  const typeIcons = {
    [CrmActivityTypeEnum.Call]: FaPhone,
    [CrmActivityTypeEnum.Email]: FaEnvelope,
    [CrmActivityTypeEnum.Meeting]: FaUsers,
    [CrmActivityTypeEnum.Task]: FaClock,
    [CrmActivityTypeEnum.Note]: FaEdit,
    [CrmActivityTypeEnum.Demo]: FaUsers,
    [CrmActivityTypeEnum.Proposal]: FaFileAlt,
  }
  return typeIcons[type]
}

export const getActivityStatusText = (status: ActivityStatusEnum) => {
  const statusLabels = {
    [ActivityStatusEnum.Planned]: 'Planlandı',
    [ActivityStatusEnum.InProgress]: 'Devam Ediyor',
    [ActivityStatusEnum.Completed]: 'Tamamlandı',
    [ActivityStatusEnum.Cancelled]: 'İptal Edildi',
  }
  return statusLabels[status]
}

export const getActivityStatusColor = (status: ActivityStatusEnum) => {
  const statusColors = {
    [ActivityStatusEnum.Planned]: 'bg-blue-100 text-blue-800 border-blue-200',
    [ActivityStatusEnum.InProgress]: 'bg-yellow-100 text-yellow-800 border-yellow-200',
    [ActivityStatusEnum.Completed]: 'bg-green-100 text-green-800 border-green-200',
    [ActivityStatusEnum.Cancelled]: 'bg-red-100 text-red-800 border-red-200',
  }
  return statusColors[status]
}

export const getOpportunityStageText = (stage: OpportunityStageEnum) => {
  const stageLabels = {
    [OpportunityStageEnum.Qualification]: 'Nitelendirme',
    [OpportunityStageEnum.NeedsAnalysis]: 'İhtiyaç Analizi',
    [OpportunityStageEnum.Proposal]: 'Teklif',
    [OpportunityStageEnum.Negotiation]: 'Müzakere',
    [OpportunityStageEnum.ClosedWon]: 'Kazanıldı',
    [OpportunityStageEnum.ClosedLost]: 'Kaybedildi',
  }
  return stageLabels[stage]
}

export const getOpportunityStageColor = (stage: OpportunityStageEnum) => {
  const stageColors = {
    [OpportunityStageEnum.Qualification]: 'bg-gray-100 text-gray-800 border-gray-200',
    [OpportunityStageEnum.NeedsAnalysis]: 'bg-blue-100 text-blue-800 border-blue-200',
    [OpportunityStageEnum.Proposal]: 'bg-yellow-100 text-yellow-800 border-yellow-200',
    [OpportunityStageEnum.Negotiation]: 'bg-orange-100 text-orange-800 border-orange-200',
    [OpportunityStageEnum.ClosedWon]: 'bg-green-100 text-green-800 border-green-200',
    [OpportunityStageEnum.ClosedLost]: 'bg-red-100 text-red-800 border-red-200',
  }
  return stageColors[stage]
}

export const getOpportunityProbabilityColor = (probability: number) => {
  if (probability >= 80) return 'text-green-600'
  if (probability >= 60) return 'text-yellow-600'
  if (probability >= 40) return 'text-orange-600'
  return 'text-red-600'
}

export const getOpportunityLeadSourceText = (source: string) => {
  const sourceLabels: Record<string, string> = {
    WEBSITE: 'Web Sitesi',
    REFERRAL: 'Referans',
    CAMPAIGN: 'Kampanya',
    TRADE_SHOW: 'Fuar',
    COLD_CALL: 'Soğuk Arama',
    SOCIAL_MEDIA: 'Sosyal Medya',
    PARTNER: 'Partner',
  }
  return sourceLabels[source] || source
}

export const getSaleOrderStatusText = (status: SaleOrderStatusEnum) => {
  const statusLabels = {
    [SaleOrderStatusEnum.Draft]: 'Taslak',
    [SaleOrderStatusEnum.Confirmed]: 'Onaylandı',
    [SaleOrderStatusEnum.InProduction]: 'Üretimde',
    [SaleOrderStatusEnum.Ready]: 'Hazır',
    [SaleOrderStatusEnum.Shipped]: 'Kargoda',
    [SaleOrderStatusEnum.Delivered]: 'Teslim Edildi',
    [SaleOrderStatusEnum.Cancelled]: 'İptal Edildi',
  }
  return statusLabels[status]
}

export const getSaleOrderStatusColor = (status: SaleOrderStatusEnum) => {
  const statusColors = {
    [SaleOrderStatusEnum.Draft]: 'bg-gray-100 text-gray-800',
    [SaleOrderStatusEnum.Confirmed]: 'bg-blue-100 text-blue-800',
    [SaleOrderStatusEnum.InProduction]: 'bg-yellow-100 text-yellow-800',
    [SaleOrderStatusEnum.Ready]: 'bg-orange-100 text-orange-800',
    [SaleOrderStatusEnum.Shipped]: 'bg-purple-100 text-purple-800',
    [SaleOrderStatusEnum.Delivered]: 'bg-green-100 text-green-800',
    [SaleOrderStatusEnum.Cancelled]: 'bg-red-100 text-red-800',
  }
  return statusColors[status]
}

export const getSaleOrderItemStatusnfo = (status: SaleOrderItemStatusEnum) => {
  const statusInfo = {
    [SaleOrderItemStatusEnum.Pending]: {
      label: 'Beklemede',
      color: 'bg-gray-100 text-gray-800',
      icon: FaClock,
      iconColor: 'text-gray-500',
    },
    [SaleOrderItemStatusEnum.Confirmed]: {
      label: 'Onaylandı',
      color: 'bg-blue-100 text-blue-800',
      icon: FaCheckCircle,
      iconColor: 'text-blue-500',
    },
    [SaleOrderItemStatusEnum.InProduction]: {
      label: 'Üretimde',
      color: 'bg-yellow-100 text-yellow-800',
      icon: FaClock,
      iconColor: 'text-yellow-500',
    },
    [SaleOrderItemStatusEnum.Ready]: {
      label: 'Hazır',
      color: 'bg-orange-100 text-orange-800',
      icon: FaCheckCircle,
      iconColor: 'text-orange-500',
    },
    [SaleOrderItemStatusEnum.Shipped]: {
      label: 'Kargoda',
      color: 'bg-purple-100 text-purple-800',
      icon: FaTruck,
      iconColor: 'text-purple-500',
    },
    [SaleOrderItemStatusEnum.Delivered]: {
      label: 'Teslim Edildi',
      color: 'bg-green-100 text-green-800',
      icon: FaCheckCircle,
      iconColor: 'text-green-500',
    },
  }
  return statusInfo[status]
}

export const getBankAccountTypeText = (type: BankAccountTypeEnum) => {
  const typeLabels = {
    [BankAccountTypeEnum.Current]: 'Vadesiz',
    [BankAccountTypeEnum.Deposit]: 'Vadeli',
    [BankAccountTypeEnum.Credit]: 'Kredi',
    [BankAccountTypeEnum.Foreign]: 'Döviz',
  }
  return typeLabels[type]
}

export const getBankAccountTypeColor = (type: BankAccountTypeEnum) => {
  const typeColors = {
    [BankAccountTypeEnum.Current]: 'bg-blue-100 text-blue-800',
    [BankAccountTypeEnum.Deposit]: 'bg-green-100 text-green-800',
    [BankAccountTypeEnum.Credit]: 'bg-orange-100 text-orange-800',
    [BankAccountTypeEnum.Foreign]: 'bg-purple-100 text-purple-800',
  }
  return typeColors[type]
}

export const getTransactionTypeText = (type: BankTransactionTypeEnum) => {
  const typeLabels = {
    [BankTransactionTypeEnum.Deposit]: 'Para Yatırma',
    [BankTransactionTypeEnum.Withdrawal]: 'Para Çekme',
    [BankTransactionTypeEnum.Transfer]: 'Transfer',
    [BankTransactionTypeEnum.EFT]: 'EFT/Havale',
    [BankTransactionTypeEnum.Fee]: 'Komisyon',
    [BankTransactionTypeEnum.Interest]: 'Faiz',
  }
  return typeLabels[type]
}

export const getTransactionTypeColor = (type: BankTransactionTypeEnum) => {
  const typeColors = {
    [BankTransactionTypeEnum.Deposit]: 'bg-green-100 text-green-800',
    [BankTransactionTypeEnum.Withdrawal]: 'bg-red-100 text-red-800',
    [BankTransactionTypeEnum.Transfer]: 'bg-blue-100 text-blue-800',
    [BankTransactionTypeEnum.EFT]: 'bg-purple-100 text-purple-800',
    [BankTransactionTypeEnum.Fee]: 'bg-orange-100 text-orange-800',
    [BankTransactionTypeEnum.Interest]: 'bg-yellow-100 text-yellow-800',
  }
  return typeColors[type]
}

export const getTransactionStatusText = (status: TransactionStatusEnum) => {
  const statusLabels = {
    [TransactionStatusEnum.Pending]: 'Bekliyor',
    [TransactionStatusEnum.Completed]: 'Tamamlandı',
    [TransactionStatusEnum.Failed]: 'Başarısız',
    [TransactionStatusEnum.Cancelled]: 'İptal',
  }
  return statusLabels[status]
}

export const getTransactionStatusColor = (status: TransactionStatusEnum) => {
  const statusColors = {
    [TransactionStatusEnum.Pending]: 'bg-yellow-100 text-yellow-800',
    [TransactionStatusEnum.Completed]: 'bg-green-100 text-green-800',
    [TransactionStatusEnum.Failed]: 'bg-red-100 text-red-800',
    [TransactionStatusEnum.Cancelled]: 'bg-gray-100 text-gray-800',
  }
  return statusColors[status]
}

export const getFiDocumentTypeText = (type?: FiDocumentTypeEnum) => {
  if (!type) return ''
  const typeLabels = {
    [FiDocumentTypeEnum.Invoice]: 'Fatura',
    [FiDocumentTypeEnum.Waybill]: 'İrsaliye',
    [FiDocumentTypeEnum.Receipt]: 'Makbuz',
    [FiDocumentTypeEnum.Payment]: 'Ödeme',
    [FiDocumentTypeEnum.BankTransfer]: 'Banka Havalesi',
    [FiDocumentTypeEnum.CashMovement]: 'Kasa Hareketi',
    [FiDocumentTypeEnum.Check]: 'Çek',
    [FiDocumentTypeEnum.PromissoryNote]: 'Senet',
    [FiDocumentTypeEnum.Other]: 'Diğer',
  }
  return typeLabels[type]
}

export const getFiDocumentTypeColor = (type: FiDocumentTypeEnum) => {
  const typeColors = {
    [FiDocumentTypeEnum.Invoice]: 'bg-blue-100 text-blue-800',
    [FiDocumentTypeEnum.Payment]: 'bg-green-100 text-green-800',
    [FiDocumentTypeEnum.Receipt]: 'bg-purple-100 text-purple-800',
    [FiDocumentTypeEnum.Check]: 'bg-yellow-100 text-yellow-800',
    [FiDocumentTypeEnum.BankTransfer]: 'bg-indigo-100 text-indigo-800',
    [FiDocumentTypeEnum.CashMovement]: 'bg-orange-100 text-orange-800',
    [FiDocumentTypeEnum.Waybill]: 'bg-gray-100 text-gray-800',
    [FiDocumentTypeEnum.PromissoryNote]: 'bg-red-100 text-red-800',
    [FiDocumentTypeEnum.Other]: 'bg-gray-100 text-gray-800',
  }
  return typeColors[type]
}

export const getCashMovementTypeText = (type: CashMovementTypeEnum) => {
  return type === CashMovementTypeEnum.Income ? 'Giriş' : 'Çıkış'
}

export const getCashMovementTypeColor = (type: CashMovementTypeEnum) => {
  return type === CashMovementTypeEnum.Income
    ? 'bg-green-100 text-green-800'
    : 'bg-red-100 text-red-800'
}

export const getAccountTypeText = (type: AccountTypeEnum) => {
  const typeLabels = {
    [AccountTypeEnum.Customer]: 'Müşteri',
    [AccountTypeEnum.Supplier]: 'Tedarikçi',
    [AccountTypeEnum.Both]: 'Müşteri/Tedarikçi',
    [AccountTypeEnum.Other]: 'Diğer',
  }
  return typeLabels[type]
}

export const getAccountTypeColor = (type: AccountTypeEnum) => {
  const typeColors = {
    [AccountTypeEnum.Customer]: 'bg-blue-100 text-blue-800',
    [AccountTypeEnum.Supplier]: 'bg-green-100 text-green-800',
    [AccountTypeEnum.Both]: 'bg-purple-100 text-purple-800',
    [AccountTypeEnum.Other]: 'bg-gray-100 text-gray-800',
  }
  return typeColors[type]
}

export const getRiskGroupText = (riskGroup: RiskGroupEnum) => {
  const riskLabels = {
    [RiskGroupEnum.Low]: 'Düşük Risk',
    [RiskGroupEnum.Medium]: 'Orta Risk',
    [RiskGroupEnum.High]: 'Yüksek Risk',
    [RiskGroupEnum.Blocked]: 'Blokeli',
  }
  return riskLabels[riskGroup]
}

export const getRiskGroupColor = (riskGroup: RiskGroupEnum) => {
  const riskColors = {
    [RiskGroupEnum.Low]: 'bg-green-100 text-green-800',
    [RiskGroupEnum.Medium]: 'bg-yellow-100 text-yellow-800',
    [RiskGroupEnum.High]: 'bg-orange-100 text-orange-800',
    [RiskGroupEnum.Blocked]: 'bg-red-100 text-red-800',
  }
  return riskColors[riskGroup]
}

export const getInvoiceTypeText = (type: InvoiceTypeEnum) => {
  const typeLabels = {
    [InvoiceTypeEnum.Sales]: 'Satış',
    [InvoiceTypeEnum.Purchase]: 'Alış',
    [InvoiceTypeEnum.Return]: 'İade',
    [InvoiceTypeEnum.Proforma]: 'Proforma',
  }
  return typeLabels[type]
}

export const getInvoiceTypeColor = (type: InvoiceTypeEnum) => {
  const typeColors = {
    [InvoiceTypeEnum.Sales]: 'bg-green-100 text-green-800',
    [InvoiceTypeEnum.Purchase]: 'bg-blue-100 text-blue-800',
    [InvoiceTypeEnum.Return]: 'bg-orange-100 text-orange-800',
    [InvoiceTypeEnum.Proforma]: 'bg-purple-100 text-purple-800',
  }
  return typeColors[type]
}

export const getInvoiceStatusText = (status: InvoiceStatusEnum) => {
  const statusLabels = {
    [InvoiceStatusEnum.Draft]: 'Taslak',
    [InvoiceStatusEnum.Sent]: 'Gönderildi',
    [InvoiceStatusEnum.Approved]: 'Onaylandı',
    [InvoiceStatusEnum.Cancelled]: 'İptal',
  }
  return statusLabels[status]
}

export const getInvoiceStatusColor = (status: InvoiceStatusEnum) => {
  const statusColors = {
    [InvoiceStatusEnum.Draft]: 'bg-gray-100 text-gray-800',
    [InvoiceStatusEnum.Sent]: 'bg-blue-100 text-blue-800',
    [InvoiceStatusEnum.Approved]: 'bg-green-100 text-green-800',
    [InvoiceStatusEnum.Cancelled]: 'bg-red-100 text-red-800',
  }
  return statusColors[status]
}

export const getPaymentStatusText = (status: PaymentStatusEnum) => {
  const statusLabels = {
    [PaymentStatusEnum.Unpaid]: 'Ödenmemiş',
    [PaymentStatusEnum.PartiallyPaid]: 'Kısmi Ödeme',
    [PaymentStatusEnum.Paid]: 'Ödenmiş',
    [PaymentStatusEnum.Overdue]: 'Vadesi Geçmiş',
  }
  return statusLabels[status]
}

export const getPaymentStatusColor = (status: PaymentStatusEnum) => {
  const statusColors = {
    [PaymentStatusEnum.Unpaid]: 'bg-yellow-100 text-yellow-800',
    [PaymentStatusEnum.PartiallyPaid]: 'bg-orange-100 text-orange-800',
    [PaymentStatusEnum.Paid]: 'bg-green-100 text-green-800',
    [PaymentStatusEnum.Overdue]: 'bg-red-100 text-red-800',
  }
  return statusColors[status]
}

export const getPaymentMethodText = (method: PaymentMethodEnum) => {
  const labels = {
    [PaymentMethodEnum.Cash]: 'Nakit',
    [PaymentMethodEnum.BankTransfer]: 'Banka Havalesi',
    [PaymentMethodEnum.CreditCard]: 'Kredi Kartı',
    [PaymentMethodEnum.Check]: 'Çek',
    [PaymentMethodEnum.PromissoryNote]: 'Senet',
  }
  return labels[method]
}

export const getWaybillTypeColor = (type: WaybillTypeEnum) => {
  const typeColors = {
    [WaybillTypeEnum.Outgoing]: 'bg-green-100 text-green-800',
    [WaybillTypeEnum.Incoming]: 'bg-blue-100 text-blue-800',
    [WaybillTypeEnum.Transfer]: 'bg-purple-100 text-purple-800',
    [WaybillTypeEnum.Return]: 'bg-orange-100 text-orange-800',
  }
  return typeColors[type]
}

export const iconOptions = [
  { value: '⭐', label: 'Yıldız' },
  { value: '🏆', label: 'Kupa' },
  { value: '🥇', label: 'Altın Madalya' },
  { value: '🥈', label: 'Gümüş Madalya' },
  { value: '🥉', label: 'Bronz Madalya' },
  { value: '👑', label: 'Taç' },
  { value: '💎', label: 'Elmas' },
  { value: '💡', label: 'Ampul' },
  { value: '🔥', label: 'Ateş' },
  { value: '⚡', label: 'Şimşek' },
  { value: '🎯', label: 'Hedef' },
  { value: '📈', label: 'Grafik' },
  { value: '🚀', label: 'Roket' },
  { value: '💪', label: 'Güç' },
  { value: '❤️', label: 'Kalp' },
]

export const getIconComponent = (iconName: string) => {
  switch (iconName) {
    case 'star':
      return FaStar
    case 'trophy':
      return FaTrophy
    case 'medal':
      return FaMedal
    case 'award':
    default:
      return FaAward
  }
}

export const getCostCenterTypeText = (type: CostCenterType): string => {
  const typeMap = {
    [CostCenterType.Revenue]: 'Gelir',
    [CostCenterType.Standard]: 'Standart',
    [CostCenterType.Discretionary]: 'İsteğe Bağlı',
    [CostCenterType.Investment]: 'Yatırım',
    [CostCenterType.Service]: 'Hizmet',
    [CostCenterType.Production]: 'Üretim',
    [CostCenterType.Support]: 'Destek',
    [CostCenterType.Administrative]: 'İdari',
  }
  return typeMap[type] || type
}

export const getCostCenterTypeColor = (type: CostCenterType): string => {
  const colorMap = {
    [CostCenterType.Revenue]: 'bg-green-100 text-green-800',
    [CostCenterType.Standard]: 'bg-blue-100 text-blue-800',
    [CostCenterType.Discretionary]: 'bg-purple-100 text-purple-800',
    [CostCenterType.Investment]: 'bg-orange-100 text-orange-800',
    [CostCenterType.Service]: 'bg-indigo-100 text-indigo-800',
    [CostCenterType.Production]: 'bg-red-100 text-red-800',
    [CostCenterType.Support]: 'bg-yellow-100 text-yellow-800',
    [CostCenterType.Administrative]: 'bg-gray-100 text-gray-800',
  }
  return colorMap[type] || 'bg-gray-100 text-gray-800'
}

export const getCampaignStatusColor = (status: CampaignStatusEnum) => {
  switch (status) {
    case CampaignStatusEnum.Draft:
      return 'bg-gray-100 text-gray-800'
    case CampaignStatusEnum.Active:
      return 'bg-green-100 text-green-800'
    case CampaignStatusEnum.Completed:
      return 'bg-blue-100 text-blue-800'
    default:
      return 'bg-gray-100 text-gray-800'
  }
}

export const getCampaignStatusText = (status: CampaignStatusEnum) => {
  switch (status) {
    case CampaignStatusEnum.Draft:
      return 'Taslak'
    case CampaignStatusEnum.Active:
      return 'Aktif'
    case CampaignStatusEnum.Completed:
      return 'Tamamlandı'
    default:
      return 'Bilinmiyor'
  }
}

export const getAssessorTypeText = (type: AssessorTypeEnum) => {
  switch (type) {
    case AssessorTypeEnum.Self:
      return 'Kendi'
    case AssessorTypeEnum.Manager:
      return 'Yönetici'
    case AssessorTypeEnum.Peer:
      return 'Meslektaş'
    case AssessorTypeEnum.Subordinate:
      return 'Ast'
    case AssessorTypeEnum.Customer:
      return 'Müşteri'
    case AssessorTypeEnum.OtherDepartment:
      return 'Diğer Departman'
    case AssessorTypeEnum.HRUpperManagement:
      return 'İK/Üst Yönetim'
    case AssessorTypeEnum.External:
      return 'Dış Paydaş'
    default:
      return 'Bilinmiyor'
  }
}

export const getAssessorTypeDescription = (type: AssessorTypeEnum) => {
  switch (type) {
    case AssessorTypeEnum.Self:
      return 'Sadece kendisi'
    case AssessorTypeEnum.Manager:
      return 'Sadece çalıştığı departmanın müdürü'
    case AssessorTypeEnum.Peer:
      return 'Sadece aynı departmanda çalıştığı eşit düzeydeki çalışanlar'
    case AssessorTypeEnum.Subordinate:
      return 'Aynı departmanda ama düzeyi değerlendirilen kişinin altında olan'
    case AssessorTypeEnum.Customer:
      return 'Sistemde kayıtlı müşterilerden seçilecek'
    case AssessorTypeEnum.External:
      return 'Sistemde kayıtlı olmayan harici değerlendirici'
    case AssessorTypeEnum.HRUpperManagement:
      return 'Sadece İK departmanında bir kişi seçilmeli'
    case AssessorTypeEnum.OtherDepartment:
      return 'Değerlendirilen kişinin çalıştığı departman dışında kalan tüm departman çalışanları'
    default:
      return ''
  }
}

export const getParticipantStatusColor = (status: ParticipantStatusEnum) => {
  switch (status) {
    case ParticipantStatusEnum.Invited:
      return 'bg-yellow-100 text-yellow-800'
    case ParticipantStatusEnum.Started:
      return 'bg-blue-100 text-blue-800'
    case ParticipantStatusEnum.Completed:
      return 'bg-green-100 text-green-800'
    default:
      return 'bg-gray-100 text-gray-800'
  }
}

export const getParticipantStatusText = (status: ParticipantStatusEnum) => {
  switch (status) {
    case ParticipantStatusEnum.Invited:
      return 'Davet Edildi'
    case ParticipantStatusEnum.Started:
      return 'Başladı'
    case ParticipantStatusEnum.Completed:
      return 'Tamamlandı'
    default:
      return 'Bilinmiyor'
  }
}

export const getEmployeeStatusText = (status: EmployeeStatusEnum) => {
  switch (status) {
    case EmployeeStatusEnum.Active:
      return 'Aktif'
    case EmployeeStatusEnum.Inactive:
      return 'Pasif'
    case EmployeeStatusEnum.OnLeave:
      return 'İzinli'
    case EmployeeStatusEnum.Suspended:
      return 'Askıda'
    case EmployeeStatusEnum.Terminated:
      return 'İşten Çıkarılmış'
    default:
      return 'Bilinmiyor'
  }
}

export const getEmployeeStatusColor = (status: EmployeeStatusEnum) => {
  switch (status) {
    case EmployeeStatusEnum.Active:
      return 'bg-green-100 text-green-800'
    case EmployeeStatusEnum.Inactive:
      return 'bg-gray-100 text-gray-800'
    case EmployeeStatusEnum.OnLeave:
      return 'bg-yellow-100 text-yellow-800'
    case EmployeeStatusEnum.Suspended:
      return 'bg-red-100 text-red-800'
    case EmployeeStatusEnum.Terminated:
      return 'bg-red-100 text-red-800'
    default:
      return 'bg-gray-100 text-gray-800'
  }
}

export const getEmployeeStatusIcon = (status: EmployeeStatusEnum) => {
  switch (status) {
    case EmployeeStatusEnum.Active:
      return <FaCheckCircle size={14} />
    case EmployeeStatusEnum.Inactive:
      return <FaClock size={14} />
    case EmployeeStatusEnum.OnLeave:
      return <FaCalendar size={14} />
    case EmployeeStatusEnum.Suspended:
      return <FaExclamationTriangle size={14} />
    case EmployeeStatusEnum.Terminated:
      return <FaExclamationTriangle size={14} />
    default:
      return <FaUsers size={14} />
  }
}

export const getEmploymentTypeColor = (type: EmploymentTypeEnum) => {
  switch (type) {
    case EmploymentTypeEnum.FullTime:
      return 'text-green-600'
    case EmploymentTypeEnum.PartTime:
      return 'text-blue-600'
    case EmploymentTypeEnum.Contract:
      return 'text-orange-600'
    case EmploymentTypeEnum.Temporary:
      return 'text-yellow-600'
    case EmploymentTypeEnum.Intern:
      return 'text-purple-600'
    case EmploymentTypeEnum.Consultant:
      return 'text-red-600'
    default:
      return 'text-gray-600'
  }
}

export const getEmploymentTypeText = (type: EmploymentTypeEnum) => {
  switch (type) {
    case EmploymentTypeEnum.FullTime:
      return 'Tam Zamanlı'
    case EmploymentTypeEnum.PartTime:
      return 'Yarı Zamanlı'
    case EmploymentTypeEnum.Contract:
      return 'Sözleşmeli'
    case EmploymentTypeEnum.Temporary:
      return 'Geçici'
    case EmploymentTypeEnum.Intern:
      return 'Stajyer'
    case EmploymentTypeEnum.Consultant:
      return 'Danışman'
    default:
      return 'Belirtilmemiş'
  }
}

export const getJobLevelText = (level: JobLevelEnum) => {
  switch (level) {
    case JobLevelEnum.Entry:
      return 'Giriş Seviyesi'
    case JobLevelEnum.Junior:
      return 'Junior'
    case JobLevelEnum.Mid:
      return 'Orta Seviye'
    case JobLevelEnum.Senior:
      return 'Senior'
    case JobLevelEnum.Lead:
      return 'Lider'
    case JobLevelEnum.Manager:
      return 'Yönetici'
    case JobLevelEnum.Director:
      return 'Direktör'
    case JobLevelEnum.Executive:
      return 'Üst Düzey Yönetici'
    default:
      return 'Belirlenmemiş'
  }
}

export const getJobLevelColor = (level: JobLevelEnum) => {
  switch (level) {
    case JobLevelEnum.Entry:
      return 'bg-gray-100 text-gray-800'
    case JobLevelEnum.Junior:
      return 'bg-blue-100 text-blue-800'
    case JobLevelEnum.Mid:
      return 'bg-green-100 text-green-800'
    case JobLevelEnum.Senior:
      return 'bg-purple-100 text-purple-800'
    case JobLevelEnum.Lead:
      return 'bg-orange-100 text-orange-800'
    case JobLevelEnum.Manager:
      return 'bg-red-100 text-red-800'
    case JobLevelEnum.Director:
      return 'bg-indigo-100 text-indigo-800'
    case JobLevelEnum.Executive:
      return 'bg-pink-100 text-pink-800'
    default:
      return 'bg-gray-100 text-gray-800'
  }
}

export const getLeaveStatusColor = (status: LeaveStatusEnum) => {
  switch (status) {
    case LeaveStatusEnum.Pending:
      return 'bg-yellow-100 text-yellow-800'
    case LeaveStatusEnum.Approved:
      return 'bg-green-100 text-green-800'
    case LeaveStatusEnum.Rejected:
      return 'bg-red-100 text-red-800'
    case LeaveStatusEnum.Cancelled:
      return 'bg-gray-100 text-gray-800'
    default:
      return 'bg-gray-100 text-gray-800'
  }
}

export const getLeaveStatusText = (status: LeaveStatusEnum) => {
  switch (status) {
    case LeaveStatusEnum.Pending:
      return 'Beklemede'
    case LeaveStatusEnum.Approved:
      return 'Onaylandı'
    case LeaveStatusEnum.Rejected:
      return 'Reddedildi'
    case LeaveStatusEnum.Cancelled:
      return 'İptal Edildi'
    default:
      return 'Bilinmiyor'
  }
}

export const getLeaveTypeText = (type: LeaveTypeEnum) => {
  switch (type) {
    case LeaveTypeEnum.Annual:
      return 'Yıllık İzin'
    case LeaveTypeEnum.Sick:
      return 'Hastalık İzni'
    case LeaveTypeEnum.Maternity:
      return 'Doğum İzni'
    case LeaveTypeEnum.Paternity:
      return 'Babalık İzni'
    case LeaveTypeEnum.Personal:
      return 'Kişisel İzin'
    case LeaveTypeEnum.Emergency:
      return 'Acil Durum İzni'
    case LeaveTypeEnum.Study:
      return 'Eğitim İzni'
    case LeaveTypeEnum.Unpaid:
      return 'Ücretsiz İzin'
    default:
      return 'Diğer'
  }
}

export const getPayrollStatusColor = (status: PayrollStatusEnum) => {
  switch (status) {
    case PayrollStatusEnum.Draft:
      return 'bg-gray-100 text-gray-800'
    case PayrollStatusEnum.Calculated:
      return 'bg-blue-100 text-blue-800'
    case PayrollStatusEnum.Approved:
      return 'bg-green-100 text-green-800'
    case PayrollStatusEnum.Paid:
      return 'bg-purple-100 text-purple-800'
    case PayrollStatusEnum.Cancelled:
      return 'bg-red-100 text-red-800'
    default:
      return 'bg-gray-100 text-gray-800'
  }
}

export const getPayrollStatusText = (status: PayrollStatusEnum) => {
  switch (status) {
    case PayrollStatusEnum.Draft:
      return 'Taslak'
    case PayrollStatusEnum.Calculated:
      return 'Hesaplandı'
    case PayrollStatusEnum.Approved:
      return 'Onaylandı'
    case PayrollStatusEnum.Paid:
      return 'Ödendi'
    case PayrollStatusEnum.Cancelled:
      return 'İptal Edildi'
    default:
      return 'Bilinmiyor'
  }
}

export const getNotificationStatusColor = (status: NotificationStatusEnum) => {
  const colors = {
    [NotificationStatusEnum.Open]: 'bg-gray-100 text-gray-800',
    [NotificationStatusEnum.Assigned]: 'bg-blue-100 text-blue-800',
    [NotificationStatusEnum.InProgress]: 'bg-orange-100 text-orange-800',
    [NotificationStatusEnum.Resolved]: 'bg-green-100 text-green-800',
    [NotificationStatusEnum.Closed]: 'bg-gray-100 text-gray-800',
    [NotificationStatusEnum.Rejected]: 'bg-red-100 text-red-800',
  }
  return colors[status]
}

export const getNotificationStatusIcon = (status: NotificationStatusEnum) => {
  const icons = {
    [NotificationStatusEnum.Open]: <FaExclamationTriangle className="w-4 h-4" />,
    [NotificationStatusEnum.Assigned]: <FaUser className="w-4 h-4" />,
    [NotificationStatusEnum.InProgress]: <FaClock className="w-4 h-4" />,
    [NotificationStatusEnum.Resolved]: <FaCheckCircle className="w-4 h-4" />,
    [NotificationStatusEnum.Closed]: <FaTimesCircle className="w-4 h-4" />,
    [NotificationStatusEnum.Rejected]: <FaTimesCircle className="w-4 h-4" />,
  }
  return icons[status]
}

export const getNotificationStatusText = (status: NotificationStatusEnum) => {
  const statuses = {
    [NotificationStatusEnum.Open]: 'Açık',
    [NotificationStatusEnum.Assigned]: 'Atandı',
    [NotificationStatusEnum.InProgress]: 'Devam Ediyor',
    [NotificationStatusEnum.Resolved]: 'Çözüldü',
    [NotificationStatusEnum.Closed]: 'Kapatıldı',
    [NotificationStatusEnum.Rejected]: 'Reddedildi',
  }
  return statuses[status]
}

export const getWorkOrderStatusText = (status: WorkOrderStatusEnum) => {
  const statuses = {
    [WorkOrderStatusEnum.Created]: 'Oluşturuldu',
    [WorkOrderStatusEnum.Planned]: 'Planlandı',
    [WorkOrderStatusEnum.Released]: 'Serbest Bırakıldı',
    [WorkOrderStatusEnum.InProgress]: 'Devam Ediyor',
    [WorkOrderStatusEnum.OnHold]: 'Beklemede',
    [WorkOrderStatusEnum.Completed]: 'Tamamlandı',
    [WorkOrderStatusEnum.Cancelled]: 'İptal Edildi',
  }
  return statuses[status]
}

export const getWorkOrderStatusColor = (status: WorkOrderStatusEnum) => {
  const colors = {
    [WorkOrderStatusEnum.Created]: 'bg-gray-100 text-gray-800',
    [WorkOrderStatusEnum.Planned]: 'bg-blue-100 text-blue-800',
    [WorkOrderStatusEnum.Released]: 'bg-purple-100 text-purple-800',
    [WorkOrderStatusEnum.InProgress]: 'bg-orange-100 text-orange-800',
    [WorkOrderStatusEnum.OnHold]: 'bg-yellow-100 text-yellow-800',
    [WorkOrderStatusEnum.Completed]: 'bg-green-100 text-green-800',
    [WorkOrderStatusEnum.Cancelled]: 'bg-red-100 text-red-800',
  }
  return colors[status]
}

export const getWorkOrderStatusIcon = (status: WorkOrderStatusEnum) => {
  const icons = {
    [WorkOrderStatusEnum.Created]: null,
    [WorkOrderStatusEnum.Planned]: null,
    [WorkOrderStatusEnum.Released]: null,
    [WorkOrderStatusEnum.InProgress]: <FaCheck className="w-4 h-4" />,
    [WorkOrderStatusEnum.OnHold]: <FaPause className="w-4 h-4" />,
    [WorkOrderStatusEnum.Completed]: <FaCheck className="w-4 h-4" />,
    [WorkOrderStatusEnum.Cancelled]: <FaTimesCircle className="w-4 h-4" />,
  }
  return icons[status]
}

export const getFaultTypeText = (type: FaultTypeEnum) => {
  const types = {
    [FaultTypeEnum.Mechanical]: 'Mekanik',
    [FaultTypeEnum.Electrical]: 'Elektrik',
    [FaultTypeEnum.Hydraulic]: 'Hidrolik',
    [FaultTypeEnum.Pneumatic]: 'Pnömatik',
    [FaultTypeEnum.Software]: 'Yazılım',
    [FaultTypeEnum.Safety]: 'Güvenlik',
    [FaultTypeEnum.Performance]: 'Performans',
    [FaultTypeEnum.Other]: 'Diğer',
  }
  return types[type]
}

export const getFaultTypeColor = (type: FaultTypeEnum) => {
  const colors = {
    [FaultTypeEnum.Mechanical]: 'bg-blue-100 text-blue-800',
    [FaultTypeEnum.Electrical]: 'bg-yellow-100 text-yellow-800',
    [FaultTypeEnum.Hydraulic]: 'bg-green-100 text-green-800',
    [FaultTypeEnum.Pneumatic]: 'bg-purple-100 text-purple-800',
    [FaultTypeEnum.Software]: 'bg-indigo-100 text-indigo-800',
    [FaultTypeEnum.Safety]: 'bg-red-100 text-red-800',
    [FaultTypeEnum.Performance]: 'bg-orange-100 text-orange-800',
    [FaultTypeEnum.Other]: 'bg-gray-100 text-gray-800',
  }
  return colors[type]
}

export const getCriticalityLevelText = (criticality: CriticalityLevelEnum) => {
  const levels = {
    [CriticalityLevelEnum.Low]: 'Düşük',
    [CriticalityLevelEnum.Medium]: 'Orta',
    [CriticalityLevelEnum.High]: 'Yüksek',
    [CriticalityLevelEnum.Critical]: 'Kritik',
  }
  return levels[criticality]
}

export const getCriticalityLevelColor = (severity: CriticalityLevelEnum) => {
  const colors = {
    [CriticalityLevelEnum.Low]: 'border-l-blue-500',
    [CriticalityLevelEnum.Medium]: 'border-l-yellow-500',
    [CriticalityLevelEnum.High]: 'border-l-orange-500',
    [CriticalityLevelEnum.Critical]: 'border-l-red-500',
  }
  return colors[severity]
}

export const getMaintenancePlanTypeText = (type: MaintenancePlanTypeEnum) => {
  const types = {
    [MaintenancePlanTypeEnum.Preventive]: 'Önleyici',
    [MaintenancePlanTypeEnum.Corrective]: 'Düzeltici',
    [MaintenancePlanTypeEnum.Predictive]: 'Tahminsel',
    [MaintenancePlanTypeEnum.Condition]: 'Duruma Bağlı',
  }
  return types[type]
}

export const getMaintenancePlanTypeColor = (type: MaintenancePlanTypeEnum) => {
  const colors = {
    [MaintenancePlanTypeEnum.Preventive]: 'bg-green-100 text-green-800',
    [MaintenancePlanTypeEnum.Corrective]: 'bg-red-100 text-red-800',
    [MaintenancePlanTypeEnum.Predictive]: 'bg-blue-100 text-blue-800',
    [MaintenancePlanTypeEnum.Condition]: 'bg-yellow-100 text-yellow-800',
  }
  return colors[type]
}

export const getFrequencyUnitText = (unit: FrequencyUnitEnum) => {
  const units = {
    [FrequencyUnitEnum.Days]: 'Günlük',
    [FrequencyUnitEnum.Weeks]: 'Haftalık',
    [FrequencyUnitEnum.Months]: 'Aylık',
    [FrequencyUnitEnum.Years]: 'Yıllık',
    [FrequencyUnitEnum.Hours]: 'Saatlik',
    [FrequencyUnitEnum.Cycles]: 'Döngü',
  }

  return units[unit]
}

export const getFrequencyUnitTextByFrequency = (frequency: number, unit: FrequencyUnitEnum) => {
  const units = {
    [FrequencyUnitEnum.Days]: 'Günlük',
    [FrequencyUnitEnum.Weeks]: 'Haftalık',
    [FrequencyUnitEnum.Months]: 'Aylık',
    [FrequencyUnitEnum.Years]: 'Yıllık',
    [FrequencyUnitEnum.Hours]: 'Saatlik',
    [FrequencyUnitEnum.Cycles]: 'Döngü',
  }

  return frequency === 1 ? units[unit] : `${frequency} ${units[unit]}`
}

export const getTeamRoleText = (role: TeamRoleEnum) => {
  const roles = {
    [TeamRoleEnum.Member]: 'Üye',
    [TeamRoleEnum.Specialist]: 'Uzman',
    [TeamRoleEnum.Lead]: 'Lider',
    [TeamRoleEnum.Manager]: 'Yönetici',
  }
  return roles[role]
}

export const getTeamRoleColor = (role: TeamRoleEnum) => {
  const colors = {
    [TeamRoleEnum.Member]: 'bg-blue-100 text-blue-800',
    [TeamRoleEnum.Specialist]: 'bg-green-100 text-green-800',
    [TeamRoleEnum.Lead]: 'bg-purple-100 text-purple-800',
    [TeamRoleEnum.Manager]: 'bg-red-100 text-red-800',
  }
  return colors[role]
}

export const getTeamRoleIcon = (role: TeamRoleEnum) => {
  const icons = {
    [TeamRoleEnum.Member]: <FaUser className="w-3 h-3" />,
    [TeamRoleEnum.Specialist]: <FaStar className="w-3 h-3" />,
    [TeamRoleEnum.Lead]: <FaAward className="w-3 h-3" />,
    [TeamRoleEnum.Manager]: <FaUserTie className="w-3 h-3" />,
  }
  return icons[role]
}

export const getWorkOrderTypeText = (type: WorkOrderTypeEnum) => {
  const types = {
    [WorkOrderTypeEnum.Preventive]: 'Önleyici',
    [WorkOrderTypeEnum.Corrective]: 'Düzeltici',
    [WorkOrderTypeEnum.Emergency]: 'Acil',
    [WorkOrderTypeEnum.Inspection]: 'İnceleme',
    [WorkOrderTypeEnum.Calibration]: 'Kalibrasyon',
  }
  return types[type]
}

export const getWorkOrderTypeColor = (type: WorkOrderTypeEnum) => {
  const colors = {
    [WorkOrderTypeEnum.Preventive]: 'bg-green-100 text-green-800',
    [WorkOrderTypeEnum.Corrective]: 'bg-blue-100 text-blue-800',
    [WorkOrderTypeEnum.Emergency]: 'bg-red-100 text-red-800',
    [WorkOrderTypeEnum.Inspection]: 'bg-purple-100 text-purple-800',
    [WorkOrderTypeEnum.Calibration]: 'bg-yellow-100 text-yellow-800',
  }
  return colors[type]
}

export const getWorkCenterStatusText = (status: WorkCenterStatusEnum) => {
  const statuses = {
    [WorkCenterStatusEnum.Operational]: 'Operasyonel',
    [WorkCenterStatusEnum.UnderMaintenance]: 'Bakımda',
    [WorkCenterStatusEnum.OutOfOrder]: 'Arızalı',
    [WorkCenterStatusEnum.Retired]: 'Emekli',
  }
  return statuses[status]
}

export const getWorkCenterStatusColor = (status: WorkCenterStatusEnum) => {
  const colors = {
    [WorkCenterStatusEnum.Operational]: 'bg-green-100 text-green-800',
    [WorkCenterStatusEnum.UnderMaintenance]: 'bg-yellow-100 text-yellow-800',
    [WorkCenterStatusEnum.OutOfOrder]: 'bg-red-100 text-red-800',
    [WorkCenterStatusEnum.Retired]: 'bg-gray-100 text-gray-800',
  }
  return colors[status]
}

export const getWorkCenterStatusIcon = (status: WorkCenterStatusEnum) => {
  switch (status) {
    case WorkCenterStatusEnum.Operational:
      return <FaCheckCircle size={14} />
    case WorkCenterStatusEnum.UnderMaintenance:
      return <FaWrench size={14} />
    case WorkCenterStatusEnum.OutOfOrder:
      return <FaExclamationTriangle size={14} />
    case WorkCenterStatusEnum.Retired:
      return <FaClock size={14} />
    default:
      return <FaCog size={14} />
  }
}

export const getRequirementSourceTypeText = (sourceType: RequirementSourceTypeEnum) => {
  const sourceLabels = {
    [RequirementSourceTypeEnum.SalesOrder]: 'Satış Siparişi',
    [RequirementSourceTypeEnum.Forecast]: 'Tahmin',
    [RequirementSourceTypeEnum.SafetyStock]: 'Güvenlik Stoku',
    [RequirementSourceTypeEnum.ProductionOrder]: 'Üretim Emri',
  }
  return sourceLabels[sourceType]
}

export const getRequirementSourceTypeColor = (sourceType: RequirementSourceTypeEnum) => {
  const sourceColors = {
    [RequirementSourceTypeEnum.SalesOrder]: 'bg-blue-100 text-blue-800',
    [RequirementSourceTypeEnum.Forecast]: 'bg-green-100 text-green-800',
    [RequirementSourceTypeEnum.SafetyStock]: 'bg-orange-100 text-orange-800',
    [RequirementSourceTypeEnum.ProductionOrder]: 'bg-purple-100 text-purple-800',
  }
  return sourceColors[sourceType]
}

export const getProductionOrderStatusColor = (status: ProductionOrderStatusEnum) => {
  switch (status) {
    case ProductionOrderStatusEnum.Created:
      return 'bg-gray-100 text-gray-800'
    case ProductionOrderStatusEnum.Released:
      return 'bg-blue-100 text-blue-800'
    case ProductionOrderStatusEnum.InProgress:
      return 'bg-yellow-100 text-yellow-800'
    case ProductionOrderStatusEnum.Completed:
      return 'bg-green-100 text-green-800'
    case ProductionOrderStatusEnum.Cancelled:
      return 'bg-red-100 text-red-800'
    case ProductionOrderStatusEnum.OnHold:
      return 'bg-orange-100 text-orange-800'
    default:
      return 'bg-gray-100 text-gray-800'
  }
}

export const getProductionOrderStatusText = (status: ProductionOrderStatusEnum) => {
  switch (status) {
    case ProductionOrderStatusEnum.Created:
      return 'Oluşturuldu'
    case ProductionOrderStatusEnum.Released:
      return 'Serbest Bırakıldı'
    case ProductionOrderStatusEnum.InProgress:
      return 'Devam Ediyor'
    case ProductionOrderStatusEnum.Completed:
      return 'Tamamlandı'
    case ProductionOrderStatusEnum.Cancelled:
      return 'İptal Edildi'
    case ProductionOrderStatusEnum.OnHold:
      return 'Beklemede'
    default:
      return 'Bilinmiyor'
  }
}

export const getProductionOrderStatusIcon = (status: ProductionOrderStatusEnum) => {
  switch (status) {
    case ProductionOrderStatusEnum.Created:
      return <FaClock size={14} />
    case ProductionOrderStatusEnum.Released:
      return <FaPlay size={14} />
    case ProductionOrderStatusEnum.InProgress:
      return <FaCog size={14} />
    case ProductionOrderStatusEnum.Completed:
      return <FaCheckCircle size={14} />
    case ProductionOrderStatusEnum.Cancelled:
      return <FaExclamationTriangle size={14} />
    case ProductionOrderStatusEnum.OnHold:
      return <FaPause size={14} />
    default:
      return <FaIndustry size={14} />
  }
}

export const getProgressPercentage = (order: MrpProductionOrder) => {
  if (order.plannedQuantity === 0) return 0
  return Math.round((order.confirmedQuantity / order.plannedQuantity) * 100)
}

export const getProgressColor = (percentage: number) => {
  if (percentage >= 90) return 'bg-green-500'
  if (percentage >= 70) return 'bg-blue-500'
  if (percentage >= 50) return 'bg-yellow-500'
  if (percentage >= 25) return 'bg-orange-500'
  return 'bg-red-500'
}

export const getProductionOrderTypeText = (type: ProductionOrderTypeEnum) => {
  switch (type) {
    case ProductionOrderTypeEnum.Standard:
      return 'Standart'
    case ProductionOrderTypeEnum.Rework:
      return 'Yeniden İşleme'
    case ProductionOrderTypeEnum.Maintenance:
      return 'Bakım'
    case ProductionOrderTypeEnum.Sample:
      return 'Numune'
    default:
      return '-'
  }
}

export const getRecommendationStatusText = (status: RecommendationStatusEnum) => {
  const statusLabels = {
    [RecommendationStatusEnum.Open]: 'Açık',
    [RecommendationStatusEnum.Implemented]: 'Uygulandı',
    [RecommendationStatusEnum.Rejected]: 'Reddedildi',
    [RecommendationStatusEnum.Expired]: 'Süresi Doldu',
  }
  return statusLabels[status]
}

export const getRecommendationStatusColor = (status: RecommendationStatusEnum) => {
  const statusColors = {
    [RecommendationStatusEnum.Open]: 'bg-blue-100 text-blue-800',
    [RecommendationStatusEnum.Implemented]: 'bg-green-100 text-green-800',
    [RecommendationStatusEnum.Rejected]: 'bg-red-100 text-red-800',
    [RecommendationStatusEnum.Expired]: 'bg-gray-100 text-gray-800',
  }
  return statusColors[status]
}

export const getPsActivityTypeText = (type: PsActivityTypeEnum): string => {
  const labels: Record<PsActivityTypeEnum, string> = {
    [PsActivityTypeEnum.WorkLog]: 'İş Kaydı',
    [PsActivityTypeEnum.StatusUpdate]: 'Durum Güncelleme',
    [PsActivityTypeEnum.Issue]: 'Sorun',
    [PsActivityTypeEnum.Meeting]: 'Toplantı',
    [PsActivityTypeEnum.Review]: 'İnceleme',
    [PsActivityTypeEnum.TaskCreated]: 'Görev Oluşturma',
    [PsActivityTypeEnum.TaskUpdated]: 'Görev Güncelleme',
    [PsActivityTypeEnum.TaskCompleted]: 'Görev Tamamlama',
    [PsActivityTypeEnum.CommentAdded]: 'Yorum Ekleme',
    [PsActivityTypeEnum.FileUploaded]: 'Dosya Yükleme',
    [PsActivityTypeEnum.StatusChanged]: 'Durum Değişikliği',
    [PsActivityTypeEnum.AssignmentChanged]: 'Atama Değişikliği',
    [PsActivityTypeEnum.MeetingScheduled]: 'Toplantı Planlama',
  }
  return labels[type] || type
}

export const getPsActivityTypeIcon = (activityType: PsActivityTypeEnum) => {
  const icons: Record<PsActivityTypeEnum, React.ComponentType<React.ComponentProps<'svg'>>> = {
    [PsActivityTypeEnum.WorkLog]: FaFileAlt,
    [PsActivityTypeEnum.StatusUpdate]: FaCog,
    [PsActivityTypeEnum.Issue]: FaFlask,
    [PsActivityTypeEnum.Meeting]: FaVideo,
    [PsActivityTypeEnum.Review]: FaEye,
    [PsActivityTypeEnum.TaskCreated]: FaPlus,
    [PsActivityTypeEnum.TaskUpdated]: FaEdit,
    [PsActivityTypeEnum.TaskCompleted]: FaCog,
    [PsActivityTypeEnum.CommentAdded]: FaComment,
    [PsActivityTypeEnum.FileUploaded]: FaFileAlt,
    [PsActivityTypeEnum.StatusChanged]: FaCog,
    [PsActivityTypeEnum.AssignmentChanged]: FaUsers,
    [PsActivityTypeEnum.MeetingScheduled]: FaVideo,
  }
  return icons[activityType] || FaCog
}

export const getPsActivityTypeColor = (activityType: PsActivityTypeEnum): string => {
  const colors: Record<PsActivityTypeEnum, string> = {
    [PsActivityTypeEnum.WorkLog]: 'bg-gray-100 text-gray-800',
    [PsActivityTypeEnum.StatusUpdate]: 'bg-blue-100 text-blue-800',
    [PsActivityTypeEnum.Issue]: 'bg-red-100 text-red-800',
    [PsActivityTypeEnum.Meeting]: 'bg-teal-100 text-teal-800',
    [PsActivityTypeEnum.Review]: 'bg-purple-100 text-purple-800',
    [PsActivityTypeEnum.TaskCreated]: 'bg-green-100 text-green-800',
    [PsActivityTypeEnum.TaskUpdated]: 'bg-blue-100 text-blue-800',
    [PsActivityTypeEnum.TaskCompleted]: 'bg-purple-100 text-purple-800',
    [PsActivityTypeEnum.CommentAdded]: 'bg-yellow-100 text-yellow-800',
    [PsActivityTypeEnum.FileUploaded]: 'bg-indigo-100 text-indigo-800',
    [PsActivityTypeEnum.StatusChanged]: 'bg-orange-100 text-orange-800',
    [PsActivityTypeEnum.AssignmentChanged]: 'bg-pink-100 text-pink-800',
    [PsActivityTypeEnum.MeetingScheduled]: 'bg-teal-100 text-teal-800',
  }
  return colors[activityType] || 'bg-gray-100 text-gray-800'
}

export const getCostTimeTrackingStatusText = (status: ProjectCostTrackingStatus) => {
  switch (status) {
    case ProjectCostTrackingStatus.OnTrack:
      return 'Planında'
    case ProjectCostTrackingStatus.AtRisk:
      return 'Risk Altında'
    case ProjectCostTrackingStatus.Delayed:
      return 'Gecikmiş'
    case ProjectCostTrackingStatus.Completed:
      return 'Tamamlandı'
    default:
      return 'Bilinmeyen'
  }
}

export const getCostTimeTrackingStatusColor = (status: ProjectCostTrackingStatus) => {
  switch (status) {
    case ProjectCostTrackingStatus.OnTrack:
      return 'bg-green-100 text-green-800'
    case ProjectCostTrackingStatus.AtRisk:
      return 'bg-yellow-100 text-yellow-800'
    case ProjectCostTrackingStatus.Delayed:
      return 'bg-red-100 text-red-800'
    case ProjectCostTrackingStatus.Completed:
      return 'bg-blue-100 text-blue-800'
    default:
      return 'bg-gray-100 text-gray-800'
  }
}

export const getCostTimeTrackingStatusIcon = (status: ProjectCostTrackingStatus) => {
  switch (status) {
    case ProjectCostTrackingStatus.OnTrack:
      return FaCheckCircle
    case ProjectCostTrackingStatus.AtRisk:
      return FaExclamationCircle
    case ProjectCostTrackingStatus.Delayed:
      return FaExclamationCircle
    case ProjectCostTrackingStatus.Completed:
      return FaCheckCircle
    default:
      return FaExclamationCircle
  }
}

export const getPsDocumentTypeText = (type: PsDocumentTypeEnum): string => {
  const typeLabels = {
    [PsDocumentTypeEnum.Specification]: 'Şartname',
    [PsDocumentTypeEnum.Design]: 'Tasarım',
    [PsDocumentTypeEnum.Contract]: 'Sözleşme',
    [PsDocumentTypeEnum.Report]: 'Rapor',
    [PsDocumentTypeEnum.Manual]: 'Kılavuz',
    [PsDocumentTypeEnum.Other]: 'Diğer',
  }
  return typeLabels[type] || type
}

export const getPhaseStatusColor = (status: PhaseStatusEnum) => {
  switch (status) {
    case PhaseStatusEnum.NotStarted:
      return 'bg-blue-100 text-blue-800'
    case PhaseStatusEnum.InProgress:
      return 'bg-yellow-100 text-yellow-800'
    case PhaseStatusEnum.Completed:
      return 'bg-green-100 text-green-800'
    case PhaseStatusEnum.OnHold:
      return 'bg-orange-100 text-orange-800'
    case PhaseStatusEnum.Cancelled:
      return 'bg-red-100 text-red-800'
    default:
      return 'bg-gray-100 text-gray-800'
  }
}

export const getPhaseStatusText = (status: PhaseStatusEnum) => {
  switch (status) {
    case PhaseStatusEnum.NotStarted:
      return 'Başlamadı'
    case PhaseStatusEnum.InProgress:
      return 'Devam Ediyor'
    case PhaseStatusEnum.Completed:
      return 'Tamamlandı'
    case PhaseStatusEnum.OnHold:
      return 'Beklemede'
    case PhaseStatusEnum.Cancelled:
      return 'İptal Edildi'
    default:
      return 'Bilinmiyor'
  }
}

export const getPhaseStatusIcon = (status: PhaseStatusEnum) => {
  switch (status) {
    case PhaseStatusEnum.NotStarted:
      return <FaClock className="w-4 h-4" />
    case PhaseStatusEnum.InProgress:
      return <FaBolt className="w-4 h-4" />
    case PhaseStatusEnum.Completed:
      return <FaCheckCircle className="w-4 h-4" />
    case PhaseStatusEnum.OnHold:
      return <FaExclamationTriangle className="w-4 h-4" />
    case PhaseStatusEnum.Cancelled:
      return <FaTimesCircle className="w-4 h-4" />
    default:
      return <FaClock className="w-4 h-4" />
  }
}

export const getProjectStatusText = (status: ProjectStatusEnum) => {
  switch (status) {
    case ProjectStatusEnum.Planning:
      return 'Planlama'
    case ProjectStatusEnum.Active:
      return 'Aktif'
    case ProjectStatusEnum.OnHold:
      return 'Beklemede'
    case ProjectStatusEnum.Completed:
      return 'Tamamlandı'
    case ProjectStatusEnum.Cancelled:
      return 'İptal Edildi'
    default:
      return 'Bilinmiyor'
  }
}

export const getProjectStatusColor = (status: ProjectStatusEnum) => {
  switch (status) {
    case ProjectStatusEnum.Planning:
      return 'bg-blue-100 text-blue-800 border-blue-200'
    case ProjectStatusEnum.Active:
      return 'bg-green-100 text-green-800 border-green-200'
    case ProjectStatusEnum.OnHold:
      return 'bg-yellow-100 text-yellow-800 border-yellow-200'
    case ProjectStatusEnum.Completed:
      return 'bg-emerald-100 text-emerald-800 border-emerald-200'
    case ProjectStatusEnum.Cancelled:
      return 'bg-red-100 text-red-800 border-red-200'
    default:
      return 'bg-gray-100 text-gray-800 border-gray-200'
  }
}

export const getProjectStatusIcon = (status: ProjectStatusEnum) => {
  switch (status) {
    case ProjectStatusEnum.Planning:
      return <FaClock className="w-4 h-4" />
    case ProjectStatusEnum.Active:
      return <FaCheckCircle className="w-4 h-4" />
    case ProjectStatusEnum.OnHold:
      return <FaPause className="w-4 h-4" />
    case ProjectStatusEnum.Completed:
      return <FaCheckCircle className="w-4 h-4" />
    case ProjectStatusEnum.Cancelled:
      return <FaBan className="w-4 h-4" />
    default:
      return <FaClock className="w-4 h-4" />
  }
}

export const getProjectTypeText = (type: ProjectTypeEnum) => {
  switch (type) {
    case ProjectTypeEnum.Internal:
      return 'İç Proje'
    case ProjectTypeEnum.Customer:
      return 'Müşteri Projesi'
    case ProjectTypeEnum.Research:
      return 'Ar-Ge Projesi'
    case ProjectTypeEnum.Maintenance:
      return 'Bakım Projesi'
    default:
      return 'Diğer'
  }
}

export const getProjectTypeColor = (type: ProjectTypeEnum) => {
  switch (type) {
    case ProjectTypeEnum.Internal:
      return 'bg-purple-100 text-purple-800 border-purple-200'
    case ProjectTypeEnum.Customer:
      return 'bg-blue-100 text-blue-800 border-blue-200'
    case ProjectTypeEnum.Research:
      return 'bg-green-100 text-green-800 border-green-200'
    case ProjectTypeEnum.Maintenance:
      return 'bg-orange-100 text-orange-800 border-orange-200'
    default:
      return 'bg-gray-100 text-gray-800 border-gray-200'
  }
}

export const getPhaseCategoryText = (category: PhaseCategoryEnum) => {
  switch (category) {
    case PhaseCategoryEnum.Planning:
      return 'Planlama'
    case PhaseCategoryEnum.Development:
      return 'Yürütme'
    case PhaseCategoryEnum.Testing:
      return 'İzleme'
    case PhaseCategoryEnum.Deployment:
      return 'Kapanış'
    case PhaseCategoryEnum.Design:
      return 'Diğer'
    default:
      return 'Bilinmeyen'
  }
}

export const getPhaseCategoryColor = (category: PhaseCategoryEnum) => {
  switch (category) {
    case PhaseCategoryEnum.Planning:
      return 'bg-purple-100 text-purple-800'
    case PhaseCategoryEnum.Development:
      return 'bg-blue-100 text-blue-800'
    case PhaseCategoryEnum.Testing:
      return 'bg-orange-100 text-orange-800'
    case PhaseCategoryEnum.Deployment:
      return 'bg-green-100 text-green-800'
    case PhaseCategoryEnum.Design:
      return 'bg-pink-100 text-pink-800'
    default:
      return 'bg-gray-100 text-gray-800'
  }
}

export const getTaskStatusText = (status: TaskStatusEnum) => {
  switch (status) {
    case TaskStatusEnum.NotStarted:
      return 'Başlanmadı'
    case TaskStatusEnum.InProgress:
      return 'Devam Ediyor'
    case TaskStatusEnum.Completed:
      return 'Tamamlandı'
    case TaskStatusEnum.OnHold:
      return 'Beklemede'
    case TaskStatusEnum.Cancelled:
      return 'İptal Edildi'
    default:
      return 'Bilinmiyor'
  }
}

export const getTaskStatusColor = (status: TaskStatusEnum) => {
  switch (status) {
    case TaskStatusEnum.NotStarted:
      return 'bg-gray-100 text-gray-800'
    case TaskStatusEnum.InProgress:
      return 'bg-blue-100 text-blue-800'
    case TaskStatusEnum.Completed:
      return 'bg-green-100 text-green-800'
    case TaskStatusEnum.OnHold:
      return 'bg-yellow-100 text-yellow-800'
    case TaskStatusEnum.Cancelled:
      return 'bg-red-100 text-red-800'
    default:
      return 'bg-gray-100 text-gray-800'
  }
}

export const getTaskStatusIcon = (status: TaskStatusEnum) => {
  switch (status) {
    case TaskStatusEnum.NotStarted:
      return <FaClock className="w-4 h-4" />
    case TaskStatusEnum.InProgress:
      return <FaBullseye className="w-4 h-4" />
    case TaskStatusEnum.Completed:
      return <FaCheckCircle className="w-4 h-4" />
    case TaskStatusEnum.OnHold:
      return <FaExclamationCircle className="w-4 h-4" />
    case TaskStatusEnum.Cancelled:
      return <FaTimesCircle className="w-4 h-4" />
    default:
      return <FaClock className="w-4 h-4" />
  }
}
export const getTaskTypeText = (taskType: TaskTypeEnum) => {
  switch (taskType) {
    case TaskTypeEnum.Development:
      return 'Geliştirme'
    case TaskTypeEnum.Testing:
      return 'Test'
    case TaskTypeEnum.Documentation:
      return 'Dokümantasyon'
    case TaskTypeEnum.Review:
      return 'İnceleme'
    case TaskTypeEnum.Deployment:
      return 'Dağıtım'
    case TaskTypeEnum.Meeting:
      return 'Toplantı'
    default:
      return 'Bilinmiyor'
  }
}

export const getTaskTypeColor = (taskType: TaskTypeEnum) => {
  switch (taskType) {
    case TaskTypeEnum.Development:
      return 'bg-purple-100 text-purple-800'
    case TaskTypeEnum.Testing:
      return 'bg-green-100 text-green-800'
    case TaskTypeEnum.Documentation:
      return 'bg-blue-100 text-blue-800'
    case TaskTypeEnum.Review:
      return 'bg-yellow-100 text-yellow-800'
    case TaskTypeEnum.Deployment:
      return 'bg-red-100 text-red-800'
    case TaskTypeEnum.Meeting:
      return 'bg-gray-100 text-gray-800'
    default:
      return 'bg-gray-100 text-gray-800'
  }
}

export const getRiskCategoryText = (category: RiskCategoryEnum): string => {
  const labels = {
    [RiskCategoryEnum.Technical]: 'Teknik',
    [RiskCategoryEnum.Schedule]: 'Program',
    [RiskCategoryEnum.Budget]: 'Bütçe',
    [RiskCategoryEnum.Resource]: 'Kaynak',
    [RiskCategoryEnum.External]: 'Dış Etken',
    [RiskCategoryEnum.Quality]: 'Kalite',
  }
  return labels[category] || category
}

export const getRiskProbabilityText = (probability: RiskProbabilityEnum): string => {
  const labels = {
    [RiskProbabilityEnum.VeryLow]: 'Çok Düşük',
    [RiskProbabilityEnum.Low]: 'Düşük',
    [RiskProbabilityEnum.Medium]: 'Orta',
    [RiskProbabilityEnum.High]: 'Yüksek',
    [RiskProbabilityEnum.VeryHigh]: 'Çok Yüksek',
  }
  return labels[probability] || probability
}

export const getRiskImpactText = (impact: RiskImpactEnum): string => {
  const labels = {
    [RiskImpactEnum.VeryLow]: 'Çok Düşük',
    [RiskImpactEnum.Low]: 'Düşük',
    [RiskImpactEnum.Medium]: 'Orta',
    [RiskImpactEnum.High]: 'Yüksek',
    [RiskImpactEnum.VeryHigh]: 'Çok Yüksek',
  }
  return labels[impact] || impact
}

export const getRiskLevelText = (level: RiskLevelEnum): string => {
  const labels = {
    [RiskLevelEnum.Low]: 'Düşük',
    [RiskLevelEnum.Medium]: 'Orta',
    [RiskLevelEnum.High]: 'Yüksek',
    [RiskLevelEnum.Critical]: 'Kritik',
  }
  return labels[level] || level
}

export const getRiskLevelColor = (level: RiskLevelEnum): string => {
  const colors = {
    [RiskLevelEnum.Low]: 'bg-green-100 text-green-800',
    [RiskLevelEnum.Medium]: 'bg-yellow-100 text-yellow-800',
    [RiskLevelEnum.High]: 'bg-orange-100 text-orange-800',
    [RiskLevelEnum.Critical]: 'bg-red-100 text-red-800',
  }
  return colors[level] || 'bg-gray-100 text-gray-800'
}

export const getRiskStatusText = (status: RiskStatusEnum): string => {
  const labels = {
    [RiskStatusEnum.Identified]: 'Tespit Edildi',
    [RiskStatusEnum.Analyzing]: 'Analiz Ediliyor',
    [RiskStatusEnum.Mitigating]: 'Önlem Alınıyor',
    [RiskStatusEnum.Monitoring]: 'İzleniyor',
    [RiskStatusEnum.Closed]: 'Kapatıldı',
  }
  return labels[status] || status
}

export const getDailyUpdateStatusColor = (status: DailyUpdateStatusEnum) => {
  switch (status) {
    case DailyUpdateStatusEnum.Draft:
      return 'bg-gray-100 text-gray-800'
    case DailyUpdateStatusEnum.Submitted:
      return 'bg-blue-100 text-blue-800'
    case DailyUpdateStatusEnum.Approved:
      return 'bg-green-100 text-green-800'
    case DailyUpdateStatusEnum.Rejected:
      return 'bg-red-100 text-red-800'
    default:
      return 'bg-gray-100 text-gray-800'
  }
}

export const getWorkTypeColor = (workType: WorkTypeEnum) => {
  const colors = {
    [WorkTypeEnum.Development]: 'bg-blue-100 text-blue-800',
    [WorkTypeEnum.Testing]: 'bg-green-100 text-green-800',
    [WorkTypeEnum.Design]: 'bg-purple-100 text-purple-800',
    [WorkTypeEnum.Documentation]: 'bg-yellow-100 text-yellow-800',
    [WorkTypeEnum.Meeting]: 'bg-orange-100 text-orange-800',
    [WorkTypeEnum.Research]: 'bg-indigo-100 text-indigo-800',
    [WorkTypeEnum.Debugging]: 'bg-red-100 text-red-800',
    [WorkTypeEnum.Review]: 'bg-teal-100 text-teal-800',
    [WorkTypeEnum.Other]: 'bg-gray-100 text-gray-800',
  }
  return colors[workType] || 'bg-gray-100 text-gray-800'
}

export const getDeliveryStatusColor = (status: DeliveryStatusEnum) => {
  const colors = {
    [DeliveryStatusEnum.Preparing]: 'bg-gray-100 text-gray-800',
    [DeliveryStatusEnum.Shipped]: 'bg-blue-100 text-blue-800',
    [DeliveryStatusEnum.InTransit]: 'bg-indigo-100 text-indigo-800',
    [DeliveryStatusEnum.OutForDelivery]: 'bg-purple-100 text-purple-800',
    [DeliveryStatusEnum.Delivered]: 'bg-green-100 text-green-800',
    [DeliveryStatusEnum.PartiallyDelivered]: 'bg-orange-100 text-orange-800',
    [DeliveryStatusEnum.Delayed]: 'bg-red-100 text-red-800',
    [DeliveryStatusEnum.Returned]: 'bg-yellow-100 text-yellow-800',
    [DeliveryStatusEnum.Cancelled]: 'bg-gray-100 text-gray-800',
  }
  return colors[status]
}

export const getDeliveryStatusIcon = (status: DeliveryStatusEnum) => {
  const icons = {
    [DeliveryStatusEnum.Preparing]: <FaBox className="w-4 h-4" />,
    [DeliveryStatusEnum.Shipped]: <FaTruck className="w-4 h-4" />,
    [DeliveryStatusEnum.InTransit]: <FaTruck className="w-4 h-4" />,
    [DeliveryStatusEnum.OutForDelivery]: <FaMapMarkerAlt className="w-4 h-4" />,
    [DeliveryStatusEnum.Delivered]: <FaCheckCircle className="w-4 h-4" />,
    [DeliveryStatusEnum.PartiallyDelivered]: <FaExclamationTriangle className="w-4 h-4" />,
    [DeliveryStatusEnum.Delayed]: <FaClock className="w-4 h-4" />,
    [DeliveryStatusEnum.Returned]: <FaBox className="w-4 h-4" />,
    [DeliveryStatusEnum.Cancelled]: <FaExclamationTriangle className="w-4 h-4" />,
  }
  return icons[status]
}

export const getConditionColor = (condition: MmDeliveryItem['condition']) => {
  const colors = {
    Good: 'bg-green-100 text-green-800',
    Damaged: 'bg-red-100 text-red-800',
    Missing: 'bg-orange-100 text-orange-800',
  }
  return colors[condition]
}

export const getConditionText = (condition: MmDeliveryItem['condition']) => {
  const texts = {
    Good: 'İyi',
    Damaged: 'Hasarlı',
    Missing: 'Eksik',
  }
  return texts[condition]
}

export const getOrderStatusText = (status: OrderStatusEnum) => {
  const texts = {
    [OrderStatusEnum.Draft]: 'Taslak',
    [OrderStatusEnum.Pending]: 'Beklemede',
    [OrderStatusEnum.Approved]: 'Onaylandı',
    [OrderStatusEnum.Sent]: 'Gönderildi',
    [OrderStatusEnum.Confirmed]: 'Onaylandı',
    [OrderStatusEnum.PartiallyDelivered]: 'Kısmi Teslim',
    [OrderStatusEnum.Delivered]: 'Teslim Edildi',
    [OrderStatusEnum.Completed]: 'Tamamlandı',
    [OrderStatusEnum.Cancelled]: 'İptal Edildi',
    [OrderStatusEnum.PartiallyReceived]: 'Kısmi Alındı',
    [OrderStatusEnum.Received]: 'Alındı',
    [OrderStatusEnum.Invoiced]: 'Faturalandırıldı',
    [OrderStatusEnum.Closed]: 'Kapandı',
  }
  return texts[status]
}

export const getOrderStatusColor = (status: OrderStatusEnum) => {
  const colors = {
    [OrderStatusEnum.Draft]: 'bg-gray-100 text-gray-800',
    [OrderStatusEnum.Pending]: 'bg-yellow-100 text-yellow-800',
    [OrderStatusEnum.Approved]: 'bg-blue-100 text-blue-800',
    [OrderStatusEnum.Sent]: 'bg-indigo-100 text-indigo-800',
    [OrderStatusEnum.Confirmed]: 'bg-purple-100 text-purple-800',
    [OrderStatusEnum.PartiallyDelivered]: 'bg-orange-100 text-orange-800',
    [OrderStatusEnum.Delivered]: 'bg-green-100 text-green-800',
    [OrderStatusEnum.Completed]: 'bg-emerald-100 text-emerald-800',
    [OrderStatusEnum.Cancelled]: 'bg-red-100 text-red-800',
    [OrderStatusEnum.PartiallyReceived]: 'bg-orange-100 text-orange-800',
    [OrderStatusEnum.Received]: 'bg-green-100 text-green-800',
    [OrderStatusEnum.Invoiced]: 'bg-blue-100 text-blue-800',
    [OrderStatusEnum.Closed]: 'bg-gray-100 text-gray-800',
  }
  return colors[status]
}

export const getOrderStatusIcon = (status: OrderStatusEnum) => {
  const icons = {
    [OrderStatusEnum.Draft]: <FaFileAlt className="w-4 h-4" />,
    [OrderStatusEnum.Pending]: <FaClock className="w-4 h-4" />,
    [OrderStatusEnum.Approved]: <FaCheckCircle className="w-4 h-4" />,
    [OrderStatusEnum.Sent]: <FaBox className="w-4 h-4" />,
    [OrderStatusEnum.Confirmed]: <FaCheckCircle className="w-4 h-4" />,
    [OrderStatusEnum.PartiallyDelivered]: <FaExclamationTriangle className="w-4 h-4" />,
    [OrderStatusEnum.Delivered]: <FaTruck className="w-4 h-4" />,
    [OrderStatusEnum.Completed]: <FaCheckCircle className="w-4 h-4" />,
    [OrderStatusEnum.Cancelled]: <FaTimesCircle className="w-4 h-4" />,
    [OrderStatusEnum.PartiallyReceived]: <FaExclamationTriangle className="w-4 h-4" />,
    [OrderStatusEnum.Received]: <FaCheckCircle className="w-4 h-4" />,
    [OrderStatusEnum.Invoiced]: <FaFileInvoiceDollar className="w-4 h-4" />,
    [OrderStatusEnum.Closed]: <FaLock className="w-4 h-4" />,
  }
  return icons[status]
}

export const getRequestStatusText = (status: RequestStatusEnum) => {
  const statuses = {
    [RequestStatusEnum.Draft]: 'Taslak',
    [RequestStatusEnum.Submitted]: 'Gönderildi',
    [RequestStatusEnum.InReview]: 'İnceleniyor',
    [RequestStatusEnum.Approved]: 'Onaylandı',
    [RequestStatusEnum.Rejected]: 'Reddedildi',
    [RequestStatusEnum.InQuotation]: 'Teklif Aşamasında',
    [RequestStatusEnum.Ordered]: 'Sipariş Verildi',
    [RequestStatusEnum.Completed]: 'Tamamlandı',
    [RequestStatusEnum.Cancelled]: 'İptal Edildi',
  }
  return statuses[status]
}

export const getRequestStatusColor = (status: RequestStatusEnum) => {
  const colors = {
    [RequestStatusEnum.Draft]: 'bg-gray-100 text-gray-800',
    [RequestStatusEnum.Submitted]: 'bg-blue-100 text-blue-800',
    [RequestStatusEnum.InReview]: 'bg-yellow-100 text-yellow-800',
    [RequestStatusEnum.Approved]: 'bg-green-100 text-green-800',
    [RequestStatusEnum.Rejected]: 'bg-red-100 text-red-800',
    [RequestStatusEnum.InQuotation]: 'bg-purple-100 text-purple-800',
    [RequestStatusEnum.Ordered]: 'bg-indigo-100 text-indigo-800',
    [RequestStatusEnum.Completed]: 'bg-green-100 text-green-800',
    [RequestStatusEnum.Cancelled]: 'bg-red-100 text-red-800',
  }
  return colors[status]
}

export const getApprovalStatusIcon = (status: ApprovalStatusEnum) => {
  switch (status) {
    case ApprovalStatusEnum.Approved:
      return <FaCheckCircle className="w-4 h-4 text-green-600" />
    case ApprovalStatusEnum.Rejected:
      return <FaTimesCircle className="w-4 h-4 text-red-600" />
    case ApprovalStatusEnum.Pending:
      return <FaClock className="w-4 h-4 text-yellow-600" />
    default:
      return <FaClock className="w-4 h-4 text-gray-600" />
  }
}

export const getRequisitionStatusText = (status: RequisitionStatusEnum) => {
  switch (status) {
    case RequisitionStatusEnum.Draft:
      return 'Taslak'
    case RequisitionStatusEnum.Submitted:
      return 'Gönderildi'
    case RequisitionStatusEnum.InApproval:
      return 'Onayda'
    case RequisitionStatusEnum.Approved:
      return 'Onaylandı'
    case RequisitionStatusEnum.Rejected:
      return 'Reddedildi'
    case RequisitionStatusEnum.Cancelled:
      return 'İptal Edildi'
    case RequisitionStatusEnum.Converted:
      return 'Siparişe Dönüştürüldü'
    default:
      return 'Bilinmiyor'
  }
}

export const getRequisitionStatusColor = (status: RequisitionStatusEnum) => {
  switch (status) {
    case RequisitionStatusEnum.Draft:
      return 'bg-gray-100 text-gray-800'
    case RequisitionStatusEnum.Submitted:
      return 'bg-blue-100 text-blue-800'
    case RequisitionStatusEnum.InApproval:
      return 'bg-yellow-100 text-yellow-800'
    case RequisitionStatusEnum.Approved:
      return 'bg-green-100 text-green-800'
    case RequisitionStatusEnum.Rejected:
      return 'bg-red-100 text-red-800'
    case RequisitionStatusEnum.Cancelled:
      return 'bg-gray-100 text-gray-800'
    case RequisitionStatusEnum.Converted:
      return 'bg-purple-100 text-purple-800'
    default:
      return 'bg-gray-100 text-gray-800'
  }
}

export const getRequisitionStatusIcon = (status: RequisitionStatusEnum) => {
  switch (status) {
    case RequisitionStatusEnum.Draft:
      return <FaFileAlt size={14} />
    case RequisitionStatusEnum.Submitted:
      return <FaClock size={14} />
    case RequisitionStatusEnum.InApproval:
      return <FaClock size={14} />
    case RequisitionStatusEnum.Approved:
      return <FaCheckCircle size={14} />
    case RequisitionStatusEnum.Rejected:
      return <FaTimesCircle size={14} />
    case RequisitionStatusEnum.Cancelled:
      return <FaTimesCircle size={14} />
    case RequisitionStatusEnum.Converted:
      return <FaCheckCircle size={14} />
    default:
      return <FaFileAlt size={14} />
  }
}

export const getQuotationStatusText = (status: QuotationStatusEnum) => {
  const statuses = {
    [QuotationStatusEnum.Draft]: 'Taslak',
    [QuotationStatusEnum.Pending]: 'Beklemede',
    [QuotationStatusEnum.UnderReview]: 'İnceleme',
    [QuotationStatusEnum.Submitted]: 'Sunuldu',
    [QuotationStatusEnum.Approved]: 'Onaylandı',
    [QuotationStatusEnum.Rejected]: 'Reddedildi',
    [QuotationStatusEnum.Expired]: 'Süresi Doldu',
  }
  return statuses[status]
}

export const getQuotationStatusColor = (status: QuotationStatusEnum) => {
  const colors = {
    [QuotationStatusEnum.Draft]: 'bg-gray-100 text-gray-800',
    [QuotationStatusEnum.Pending]: 'bg-yellow-100 text-yellow-800',
    [QuotationStatusEnum.UnderReview]: 'bg-blue-100 text-blue-800',
    [QuotationStatusEnum.Submitted]: 'bg-indigo-100 text-indigo-800',
    [QuotationStatusEnum.Approved]: 'bg-green-100 text-green-800',
    [QuotationStatusEnum.Rejected]: 'bg-red-100 text-red-800',
    [QuotationStatusEnum.Expired]: 'bg-orange-100 text-orange-800',
  }
  return colors[status]
}

export const getQuotationStatusIcon = (status: QuotationStatusEnum) => {
  const icons = {
    [QuotationStatusEnum.Draft]: <FaFileAlt className="w-4 h-4" />,
    [QuotationStatusEnum.Pending]: <FaClock className="w-4 h-4" />,
    [QuotationStatusEnum.UnderReview]: <FaEye className="w-4 h-4" />,
    [QuotationStatusEnum.Submitted]: <FaFileAlt className="w-4 h-4" />,
    [QuotationStatusEnum.Approved]: <FaCheckCircle className="w-4 h-4" />,
    [QuotationStatusEnum.Rejected]: <FaTimesCircle className="w-4 h-4" />,
    [QuotationStatusEnum.Expired]: <FaExclamationCircle className="w-4 h-4" />,
  }
  return icons[status]
}

export const getSupplierCardTypeText = (type: SupplierCardTypeEnum) => {
  const types = {
    [SupplierCardTypeEnum.Standard]: 'Standart',
    [SupplierCardTypeEnum.Premium]: 'Premium',
    [SupplierCardTypeEnum.Strategic]: 'Stratejik',
    [SupplierCardTypeEnum.Preferred]: 'Tercihli',
  }
  return types[type]
}

export const getSupplierCardTypeColor = (type: SupplierCardTypeEnum) => {
  const colors = {
    [SupplierCardTypeEnum.Standard]: 'bg-gray-100 text-gray-800 border-gray-200',
    [SupplierCardTypeEnum.Premium]: 'bg-blue-100 text-blue-800 border-blue-200',
    [SupplierCardTypeEnum.Strategic]: 'bg-purple-100 text-purple-800 border-purple-200',
    [SupplierCardTypeEnum.Preferred]: 'bg-green-100 text-green-800 border-green-200',
  }
  return colors[type]
}

export const getPaymentTermsText = (terms: PaymentTerms) => {
  const termsMap = {
    [PaymentTerms.Cash]: 'Peşin',
    [PaymentTerms.Net15]: 'Net 15',
    [PaymentTerms.Net30]: 'Net 30',
    [PaymentTerms.Net45]: 'Net 45',
    [PaymentTerms.Net60]: 'Net 60',
    [PaymentTerms.Net90]: 'Net 90',
    [PaymentTerms.COD]: 'Kapıda Ödeme',
    [PaymentTerms.Prepaid]: 'Ön Ödeme',
  }
  return termsMap[terms] || terms
}

export const getSupplierTypeText = (type: SupplierTypeEnum) => {
  switch (type) {
    case SupplierTypeEnum.Wholesaler:
      return 'Toptancı'
    case SupplierTypeEnum.Distributor:
      return 'Distribütör'
    case SupplierTypeEnum.ServiceProvider:
      return 'Hizmet Sağlayıcı'
    case SupplierTypeEnum.Other:
      return 'Diğer'
    default:
      return 'Bilinmiyor'
  }
}

export const getSupplierTypeColor = (type: SupplierTypeEnum) => {
  switch (type) {
    case SupplierTypeEnum.Wholesaler:
      return 'bg-blue-100 text-blue-800'
    case SupplierTypeEnum.Distributor:
      return 'bg-green-100 text-green-800'
    case SupplierTypeEnum.ServiceProvider:
      return 'bg-purple-100 text-purple-800'
    case SupplierTypeEnum.Other:
      return 'bg-gray-100 text-gray-800'
    default:
      return 'bg-gray-100 text-gray-800'
  }
}

export const getRatingColor = (rating: number) => {
  if (rating >= 4.5) return 'text-green-600'
  if (rating >= 4.0) return 'text-yellow-600'
  if (rating >= 3.0) return 'text-orange-600'
  return 'text-red-600'
}

export const getLocationTypeText = (type: LocationTypeEnum) => {
  const labels = {
    [LocationTypeEnum.Shelf]: 'Raf',
    [LocationTypeEnum.Bin]: 'Kutu',
    [LocationTypeEnum.Floor]: 'Zemin',
    [LocationTypeEnum.Rack]: 'Yüksek Raf',
    [LocationTypeEnum.Tank]: 'Tank',
  }
  return labels[type]
}

export const getZoneTypeText = (type: ZoneTypeEnum) => {
  const labels = {
    [ZoneTypeEnum.Storage]: 'Depolama',
    [ZoneTypeEnum.Receiving]: 'Giriş',
    [ZoneTypeEnum.Shipping]: 'Sevkiyat',
    [ZoneTypeEnum.Picking]: 'Toplama',
    [ZoneTypeEnum.Quality]: 'Kalite',
    [ZoneTypeEnum.Staging]: 'Hazırlık',
  }
  return labels[type]
}

export const getQualityStatusText = (status: QualityStatusEnum) => {
  switch (status) {
    case QualityStatusEnum.Approved:
      return 'Onaylandı'
    case QualityStatusEnum.Rejected:
      return 'Reddedildi'
    case QualityStatusEnum.Quarantine:
      return 'Karantina'
    case QualityStatusEnum.Pending:
      return 'Beklemede'
    case QualityStatusEnum.Conditional:
      return 'Koşullu Onay'
    default:
      return 'Bilinmeyen'
  }
}

export const getQualityStatusColor = (status: QualityStatusEnum) => {
  switch (status) {
    case QualityStatusEnum.Approved:
      return 'bg-green-100 text-green-800'
    case QualityStatusEnum.Rejected:
      return 'bg-red-100 text-red-800'
    case QualityStatusEnum.Quarantine:
      return 'bg-yellow-100 text-yellow-800'
    case QualityStatusEnum.Pending:
      return 'bg-blue-100 text-blue-800'
    case QualityStatusEnum.Conditional:
      return 'bg-purple-100 text-purple-800'
    default:
      return 'bg-gray-100 text-gray-800'
  }
}

export const getReceiptStatusText = (status: ReceiptStatusEnum) => {
  switch (status) {
    case ReceiptStatusEnum.Pending:
      return 'Beklemede'
    case ReceiptStatusEnum.InProgress:
      return 'İşlemde'
    case ReceiptStatusEnum.Completed:
      return 'Tamamlandı'
    case ReceiptStatusEnum.OnHold:
      return 'Bekletildi'
    default:
      return 'Bilinmeyen'
  }
}

export const getReceiptStatusColor = (status: ReceiptStatusEnum) => {
  switch (status) {
    case ReceiptStatusEnum.Pending:
      return 'bg-blue-100 text-blue-800'
    case ReceiptStatusEnum.InProgress:
      return 'bg-yellow-100 text-yellow-800'
    case ReceiptStatusEnum.Completed:
      return 'bg-green-100 text-green-800'
    case ReceiptStatusEnum.OnHold:
      return 'bg-red-100 text-red-800'
    default:
      return 'bg-gray-100 text-gray-800'
  }
}

export const getSerialStatusText = (status: SerialStatusEnum) => {
  switch (status) {
    case SerialStatusEnum.Available:
      return 'Müsait'
    case SerialStatusEnum.InUse:
      return 'Kullanımda'
    case SerialStatusEnum.Maintenance:
      return 'Bakımda'
    case SerialStatusEnum.Disposed:
      return 'İmha Edildi'
    default:
      return 'Bilinmeyen'
  }
}

export const getSerialStatusColor = (status: SerialStatusEnum) => {
  switch (status) {
    case SerialStatusEnum.Available:
      return 'bg-green-100 text-green-800'
    case SerialStatusEnum.InUse:
      return 'bg-blue-100 text-blue-800'
    case SerialStatusEnum.Maintenance:
      return 'bg-yellow-100 text-yellow-800'
    case SerialStatusEnum.Disposed:
      return 'bg-red-100 text-red-800'
    default:
      return 'bg-gray-100 text-gray-800'
  }
}

export const getStockStatusText = (status: StockStatusEnum) => {
  const labels = {
    [StockStatusEnum.Available]: 'Mevcut',
    [StockStatusEnum.Reserved]: 'Rezerve',
    [StockStatusEnum.Blocked]: 'Blokeli',
    [StockStatusEnum.InTransit]: 'Transfer Halinde',
    [StockStatusEnum.Quarantine]: 'Karantina',
  }
  return labels[status]
}

export const getStockStatusColor = (status: StockStatusEnum) => {
  const colors = {
    [StockStatusEnum.Available]: 'bg-green-100 text-green-800',
    [StockStatusEnum.Reserved]: 'bg-yellow-100 text-yellow-800',
    [StockStatusEnum.Blocked]: 'bg-red-100 text-red-800',
    [StockStatusEnum.InTransit]: 'bg-blue-100 text-blue-800',
    [StockStatusEnum.Quarantine]: 'bg-purple-100 text-purple-800',
  }
  return colors[status]
}

export const getPutawayStrategyText = (strategy: PutawayStrategyEnum) => {
  const labels = {
    [PutawayStrategyEnum.FIFO]: 'İlk Giren İlk Çıkar (FIFO)',
    [PutawayStrategyEnum.LIFO]: 'Son Giren İlk Çıkar (LIFO)',
    [PutawayStrategyEnum.NearestLocation]: 'En Yakın Lokasyon',
    [PutawayStrategyEnum.EmptyLocation]: 'Boş Lokasyon',
    [PutawayStrategyEnum.SameProduct]: 'Aynı Ürün Gruplaması',
  }
  return labels[strategy]
}

export const getPutawayStrategyColor = (strategy: PutawayStrategyEnum) => {
  const colors = {
    [PutawayStrategyEnum.FIFO]: 'bg-green-100 text-green-800',
    [PutawayStrategyEnum.LIFO]: 'bg-red-100 text-red-800',
    [PutawayStrategyEnum.NearestLocation]: 'bg-blue-100 text-blue-800',
    [PutawayStrategyEnum.EmptyLocation]: 'bg-purple-100 text-purple-800',
    [PutawayStrategyEnum.SameProduct]: 'bg-yellow-100 text-yellow-800',
  }
  return colors[strategy]
}

export const getConditionTypeText = (type: ConditionTypeEnum) => {
  const labels = {
    [ConditionTypeEnum.MaterialType]: 'Malzeme Tipi',
    [ConditionTypeEnum.MaterialGroup]: 'Malzeme Grubu',
    [ConditionTypeEnum.Quantity]: 'Miktar',
    [ConditionTypeEnum.Weight]: 'Ağırlık',
    [ConditionTypeEnum.Volume]: 'Hacim',
  }
  return labels[type]
}

export const getConditionOperatorText = (operator: ConditionOperatorEnum) => {
  const labels = {
    [ConditionOperatorEnum.Equals]: 'Eşittir',
    [ConditionOperatorEnum.NotEquals]: 'Eşit Değildir',
    [ConditionOperatorEnum.GreaterThan]: 'Büyüktür',
    [ConditionOperatorEnum.LessThan]: 'Küçüktür',
    [ConditionOperatorEnum.Contains]: 'İçerir',
  }
  return labels[operator]
}

export const getCountTypeText = (type: CountTypeEnum) => {
  const labels = {
    [CountTypeEnum.Full]: 'Tam Sayım',
    [CountTypeEnum.Cycle]: 'Döngüsel Sayım',
    [CountTypeEnum.Spot]: 'Nokta Sayım',
  }
  return labels[type]
}

export const getCountStatusText = (status: CountStatusEnum) => {
  const labels = {
    [CountStatusEnum.Planned]: 'Planlandı',
    [CountStatusEnum.InProgress]: 'Devam Ediyor',
    [CountStatusEnum.Completed]: 'Tamamlandı',
    [CountStatusEnum.Approved]: 'Onaylandı',
  }
  return labels[status]
}

export const getCountStatusColor = (status: CountStatusEnum) => {
  const colors = {
    [CountStatusEnum.Planned]: 'bg-gray-100 text-gray-800',
    [CountStatusEnum.InProgress]: 'bg-blue-100 text-blue-800',
    [CountStatusEnum.Completed]: 'bg-yellow-100 text-yellow-800',
    [CountStatusEnum.Approved]: 'bg-green-100 text-green-800',
  }
  return colors[status]
}

export const getMovementStatusText = (status: MovementStatusEnum) => {
  const labels = {
    [MovementStatusEnum.Planned]: 'Planlandı',
    [MovementStatusEnum.InProgress]: 'Devam Ediyor',
    [MovementStatusEnum.Completed]: 'Tamamlandı',
    [MovementStatusEnum.Cancelled]: 'İptal Edildi',
  }
  return labels[status]
}

export const getMovementStatusColor = (status: MovementStatusEnum) => {
  const colors = {
    [MovementStatusEnum.Planned]: 'bg-gray-100 text-gray-800',
    [MovementStatusEnum.InProgress]: 'bg-blue-100 text-blue-800',
    [MovementStatusEnum.Completed]: 'bg-green-100 text-green-800',
    [MovementStatusEnum.Cancelled]: 'bg-red-100 text-red-800',
  }
  return colors[status]
}

export const getMovementStatusIcon = (status: MovementStatusEnum) => {
  const icons = {
    [MovementStatusEnum.Planned]: FaClock,
    [MovementStatusEnum.InProgress]: FaArrowCircleDown,
    [MovementStatusEnum.Completed]: FaCheckCircle,
    [MovementStatusEnum.Cancelled]: FaExclamationCircle,
  }
  return icons[status]
}

export const getForecastMethodText = (method: ForecastMethodEnum) => {
  const methodLabels = {
    [ForecastMethodEnum.MovingAverage]: 'Hareketli Ortalama',
    [ForecastMethodEnum.ExponentialSmoothing]: 'Üstel Yumuşatma',
    [ForecastMethodEnum.LinearRegression]: 'Doğrusal Regresyon',
    [ForecastMethodEnum.Seasonal]: 'Mevsimsel',
  }
  return methodLabels[method]
}

export const getAccuracyColor = (accuracy: number) => {
  if (accuracy >= 90) return 'text-green-600'
  if (accuracy >= 75) return 'text-yellow-600'
  return 'text-red-600'
}

export const getCheckStatusText = (status: CheckStatusEnum) => {
  const statusLabels = {
    [CheckStatusEnum.InHand]: 'Elde',
    [CheckStatusEnum.Deposited]: 'Bankaya Verildi',
    [CheckStatusEnum.Collected]: 'Tahsil Edildi',
    [CheckStatusEnum.Bounced]: 'Karşılıksız',
    [CheckStatusEnum.Endorsed]: 'Ciro Edildi',
    [CheckStatusEnum.Cancelled]: 'İptal',
  }
  return statusLabels[status]
}

export const getCheckStatusColor = (status: CheckStatusEnum) => {
  const statusColors = {
    [CheckStatusEnum.InHand]: 'bg-blue-100 text-blue-800',
    [CheckStatusEnum.Deposited]: 'bg-yellow-100 text-yellow-800',
    [CheckStatusEnum.Collected]: 'bg-green-100 text-green-800',
    [CheckStatusEnum.Bounced]: 'bg-red-100 text-red-800',
    [CheckStatusEnum.Endorsed]: 'bg-purple-100 text-purple-800',
    [CheckStatusEnum.Cancelled]: 'bg-gray-100 text-gray-800',
  }
  return statusColors[status]
}

export const getNoteStatusText = (status: NoteStatusEnum) => {
  const statusLabels = {
    [NoteStatusEnum.InHand]: 'Elde',
    [NoteStatusEnum.Collected]: 'Tahsil Edildi',
    [NoteStatusEnum.Overdue]: 'Vadesi Geçmiş',
    [NoteStatusEnum.Endorsed]: 'Ciro Edildi',
    [NoteStatusEnum.Cancelled]: 'İptal',
  }
  return statusLabels[status]
}

export const getNoteStatusColor = (status: NoteStatusEnum) => {
  const statusColors = {
    [NoteStatusEnum.InHand]: 'bg-blue-100 text-blue-800',
    [NoteStatusEnum.Collected]: 'bg-green-100 text-green-800',
    [NoteStatusEnum.Overdue]: 'bg-red-100 text-red-800',
    [NoteStatusEnum.Endorsed]: 'bg-purple-100 text-purple-800',
    [NoteStatusEnum.Cancelled]: 'bg-gray-100 text-gray-800',
  }
  return statusColors[status]
}

export const getTypeText = (status: TypeEnum) => {
  const statusLabels = {
    [TypeEnum.Received]: 'Alınan',
    [TypeEnum.Issued]: 'Verilen',
  }
  return statusLabels[status]
}

export const getGanttStatusColor = (
  status: TaskStatusEnum | ProjectStatusEnum | PhaseStatusEnum,
) => {
  switch (status) {
    case TaskStatusEnum.Completed:
    case ProjectStatusEnum.Completed:
    case PhaseStatusEnum.Completed:
      return 'bg-gradient-to-r from-green-500 to-green-700'
    case TaskStatusEnum.InProgress:
    case ProjectStatusEnum.Active:
    case PhaseStatusEnum.InProgress:
      return 'bg-gradient-to-r from-blue-500 to-blue-700'
    case TaskStatusEnum.OnHold:
    case ProjectStatusEnum.OnHold:
    case PhaseStatusEnum.OnHold:
      return 'bg-gradient-to-r from-yellow-500 to-orange-600'
    case TaskStatusEnum.Cancelled:
    case ProjectStatusEnum.Cancelled:
    case PhaseStatusEnum.Cancelled:
      return 'bg-gradient-to-r from-red-500 to-red-700'
    default:
      return 'bg-gradient-to-r from-black-500 to-black-700'
  }
}

export const getGenderText = (status: GenderEnum) => {
  const genderLabels = {
    [GenderEnum.Male]: 'Erkek',
    [GenderEnum.Female]: 'Kadın',
    [GenderEnum.Other]: 'Diğer',
  }
  return genderLabels[status]
}

export const getMaritalStatusText = (status: MaritalStatusEnum) => {
  const statusLabels = {
    [MaritalStatusEnum.Single]: 'Bekar',
    [MaritalStatusEnum.Married]: 'Evli',
    [MaritalStatusEnum.Divorced]: 'Boşanmış',
    [MaritalStatusEnum.Widowed]: 'Dul',
  }
  return statusLabels[status]
}

export const getCustomerTypeText = (type: CustomerTypeEnum) => {
  switch (type) {
    case CustomerTypeEnum.Individual:
      return 'Bireysel'
    case CustomerTypeEnum.Company:
      return 'Şirket'
    case CustomerTypeEnum.Government:
      return 'Devlet'
    case CustomerTypeEnum.NonProfit:
      return 'Kar Amacı Gütmeyen'
    default:
      return 'Bilinmeyen'
  }
}

export const getBusinessPartyIndustryText = (industry: BusinessPartyIndustryEnum | string) => {
  switch (industry) {
    case BusinessPartyIndustryEnum.Technology:
      return 'Teknoloji'
    case BusinessPartyIndustryEnum.Healthcare:
      return 'Sağlık'
    case BusinessPartyIndustryEnum.Finance:
      return 'Finans'
    case BusinessPartyIndustryEnum.Retail:
      return 'Perakende'
    case BusinessPartyIndustryEnum.Manufacturing:
      return 'İmalat'
    case BusinessPartyIndustryEnum.Education:
      return 'Eğitim'
    case BusinessPartyIndustryEnum.Construction:
      return 'İnşaat'
    case BusinessPartyIndustryEnum.Hospitality:
      return 'Konaklama'
    case BusinessPartyIndustryEnum.Transportation:
      return 'Ulaşım'
    case BusinessPartyIndustryEnum.RealEstate:
      return 'Emlak'
    case BusinessPartyIndustryEnum.Other:
      return 'Diğer'
    case 'AUTOMOTIVE': // Optionlarda var, enumda yok
      return 'Otomotiv'
    default:
      return 'Bilinmeyen'
  }
}
