mirror of
https://github.com/complexcaresolutions/cms.c2sgmbh.git
synced 2026-03-18 00:24:10 +00:00
- 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>
35 lines
1.2 KiB
TypeScript
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
|