'use client' import React from 'react' import { COLLECTIONS } from './ChunkBrowserConstants' import { getRegName } from './ChunkBrowserHelpers' interface ChunkBrowserToolbarProps { collection: string onCollectionChange: (col: string) => void selectedRegulation: string | null structInfo: { article?: string; section?: string; pages?: string } docChunkIndex: number docTotalChunks: number docChunksLength: number chunksPerPage: number setChunksPerPage: (v: number) => void splitViewActive: boolean setSplitViewActive: (v: boolean) => void fullscreen: boolean setFullscreen: (v: boolean) => void onPrev: () => void onNext: () => void onJumpTo: (idx: number) => void } export function ChunkBrowserToolbar({ collection, onCollectionChange, selectedRegulation, structInfo, docChunkIndex, docTotalChunks, docChunksLength, chunksPerPage, setChunksPerPage, splitViewActive, setSplitViewActive, fullscreen, setFullscreen, onPrev, onNext, onJumpTo, }: ChunkBrowserToolbarProps) { return (
{selectedRegulation && ( <>
{selectedRegulation} — {getRegName(selectedRegulation)} {structInfo.article && ( {structInfo.article} )} {structInfo.pages && ( {structInfo.pages} )}
{docChunkIndex + 1} / {docTotalChunks} { const v = parseInt(e.target.value, 10) if (!isNaN(v) && v >= 1 && v <= docTotalChunks) onJumpTo(v - 1) }} className="w-16 px-2 py-1 border rounded text-xs text-center" title="Springe zu Chunk Nr." />
)}
) }