'use client' import type { TrainingModule, TrainingBlockConfig, CanonicalControlMeta, BlockPreview, BlockGenerateResult, } from '@/lib/sdk/training/types' import { TARGET_AUDIENCE_LABELS, ROLE_LABELS, REGULATION_LABELS } from '@/lib/sdk/training/types' interface BlocksSectionProps { blocks: TrainingBlockConfig[] canonicalMeta: CanonicalControlMeta | null blockPreview: BlockPreview | null blockPreviewId: string blockGenerating: boolean blockResult: BlockGenerateResult | null showBlockCreate: boolean onShowBlockCreate: (show: boolean) => void onPreviewBlock: (id: string) => void onGenerateBlock: (id: string) => void onDeleteBlock: (id: string) => void onCreateBlock: (data: { name: string; description?: string; domain_filter?: string; category_filter?: string; severity_filter?: string; target_audience_filter?: string; regulation_area: string; module_code_prefix: string; max_controls_per_module?: number; }) => void } export function BlocksSection({ blocks, canonicalMeta, blockPreview, blockPreviewId, blockGenerating, blockResult, showBlockCreate, onShowBlockCreate, onPreviewBlock, onGenerateBlock, onDeleteBlock, onCreateBlock, }: BlocksSectionProps) { return (
Canonical Controls nach Kriterien filtern und automatisch Schulungsmodule generieren {canonicalMeta && ({canonicalMeta.total} Controls verfuegbar)}
| Name | Domain | Zielgruppe | Severity | Prefix | Letzte Generierung | Aktionen |
|---|---|---|---|---|---|---|
|
{block.name}
{block.description && {block.description} }
|
{block.domain_filter || 'Alle'} | {block.target_audience_filter ? (TARGET_AUDIENCE_LABELS[block.target_audience_filter] || block.target_audience_filter) : 'Alle'} | {block.severity_filter || 'Alle'} | {block.module_code_prefix} |
{block.last_generated_at ? new Date(block.last_generated_at).toLocaleString('de-DE') : 'Noch nie'} |
|
{ctrl.control_id}
{ctrl.title}
{ctrl.severity}