cms.c2sgmbh/src/components/admin/TenantBreadcrumb.tsx
Martin Porwoll ce4962e74b feat: BullMQ queue system for email and PDF processing
- Add BullMQ-based job queue with Redis backend
- Implement email worker with tenant-specific SMTP support
- Add PDF worker with Playwright for HTML/URL-to-PDF generation
- Create /api/generate-pdf endpoint with job status polling
- Fix TypeScript errors in Tenants, TenantBreadcrumb, TenantDashboard
- Fix type casts in auditAuthEvents and audit-service
- Remove credentials from ecosystem.config.cjs (now loaded via dotenv)
- Fix ESM __dirname issue with fileURLToPath for PM2 compatibility

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-09 22:59:17 +00:00

35 lines
1.2 KiB
TypeScript

'use client'
import React from 'react'
import { useTenantSelection } from '@payloadcms/plugin-multi-tenant/client'
import './TenantBreadcrumb.scss'
/**
* Custom Breadcrumb-Komponente die den aktuellen Tenant-Kontext anzeigt.
* Wird in der Admin-Header-Leiste eingefügt.
*/
export const TenantBreadcrumb: React.FC = () => {
const { selectedTenantID, options } = useTenantSelection()
// Finde den aktuellen Tenant aus den Optionen
const currentTenant = options?.find((opt) => opt.value === selectedTenantID)
// Zeige nichts wenn kein Tenant ausgewählt oder nur ein Tenant verfügbar
if (!selectedTenantID || !currentTenant || options.length <= 1) {
return null
}
// Handle localized labels (Record<string, string>) or plain strings
const displayLabel = typeof currentTenant.label === 'string'
? currentTenant.label
: (currentTenant.label as Record<string, string>)?.de || (currentTenant.label as Record<string, string>)?.en || String(currentTenant.value)
return (
<div className="tenant-breadcrumb">
<span className="tenant-breadcrumb__label">Aktiver Tenant:</span>
<span className="tenant-breadcrumb__value">{displayLabel}</span>
</div>
)
}
export default TenantBreadcrumb