"use client" import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faFilePdf, faChevronDown, faCheckCircle, faMoneyBillWave, faFileText, faChevronLeft, faChevronRight, faAngleDoubleLeft, faAngleDoubleRight } from '@fortawesome/free-solid-svg-icons'; import { useState } from 'react'; import documentsData from '@/data/documents.json'; interface TableCellProps { children: React.ReactNode; className?: string; } const TableCell = ({ children, className = "" }: TableCellProps) => ( {children} ); const StatusBadge = ({ status }: { status: string }) => { if (status === "approved") { return ( ); } return ( ); }; const PriceBadge = ({ price }: { price: number }) => { if (price === 0) { return 0,00; } return {price.toFixed(2)}; }; export default function DocumentsPage() { const [selectedDocumentType, setSelectedDocumentType] = useState("select_document"); const [isDropdownOpen, setIsDropdownOpen] = useState(false); const [comment, setComment] = useState(""); const [currentPage, setCurrentPage] = useState(1); const [recordsPerPage, setRecordsPerPage] = useState(15); const selectedDocument = documentsData.documentTypes.find(d => d.id === selectedDocumentType); const { documents, paymentInfo } = documentsData; const totalPages = Math.ceil(documents.length / recordsPerPage); const startIndex = (currentPage - 1) * recordsPerPage; const endIndex = startIndex + recordsPerPage; const currentDocuments = documents.slice(startIndex, endIndex); return (
{/* Header */}

Документи

Барање и преглед на документи

{/* Document Request Form */}

Ново барање за документ

{/* Document Type Selection */}
{isDropdownOpen && (
{documentsData.documentTypes.map((docType) => ( ))}
)}
{/* Comment Section */}