-
-
Отправлено всем сотрудникам
+ {/* File Info */}
+ {selectedDocument.file_name && (
+
+
+
+
+
+
Файл
+
+ {selectedDocument.file_name}
+
+
)}
-
- {selectedDocument.departments && selectedDocument.departments.length > 0 && (
-
-
-
- Отделы
+
+ {/* File Size */}
+ {selectedDocument.file_size && (
+
+
+
-
- {selectedDocument.departments.map((dept) => (
-
- {dept.name}
+
+
Размер
+
+ {(selectedDocument.file_size / 1024 / 1024).toFixed(2)} МБ
+
+
+
+ )}
+
+
+ {/* Folder Path */}
+ {selectedDocument.folder_path && (
+
+
+
+ Расположение
+
+
+ {selectedDocument.folder_path}
+
+
+ )}
+
+ {/* Description */}
+
+
+
+ Описание
+
+
+ {selectedDocument.description || "Описание отсутствует"}
+
+
+
+ {/* Recipients & Departments */}
+ {(selectedDocument.sent_to_all ||
+ (selectedDocument.recipients &&
+ selectedDocument.recipients.length > 0) ||
+ (selectedDocument.departments &&
+ selectedDocument.departments.length > 0)) && (
+
+
+
+ Получатели
+
+
+ {selectedDocument.sent_to_all && (
+
+
+
+ Отправлено всем сотрудникам
- ))}
-
-
- )}
+
+ )}
- {selectedDocument.recipients && selectedDocument.recipients.length > 0 && (
-
-
-
- Конкретные получатели ({selectedDocument.recipients.length})
-
-
- {selectedDocument.recipients.slice(0, 10).map((recipient) => (
-
- {recipient.last_name} {recipient.first_name}
-
- ))}
- {selectedDocument.recipients.length > 10 && (
-
- ... и ещё {selectedDocument.recipients.length - 10}
+ {selectedDocument.departments &&
+ selectedDocument.departments.length > 0 && (
+
+
+
+ Отделы
+
+
+ {selectedDocument.departments.map((dept) => (
+
+ {dept.name}
+
+ ))}
+
+
+ )}
+
+ {selectedDocument.recipients &&
+ selectedDocument.recipients.length > 0 && (
+
+
+
+ Конкретные получатели (
+ {selectedDocument.recipients.length})
+
+
+ {selectedDocument.recipients
+ .slice(0, 10)
+ .map((recipient) => (
+
+ {recipient.last_name} {recipient.first_name}
+
+ ))}
+ {selectedDocument.recipients.length > 10 && (
+
+ ... и ещё{" "}
+ {selectedDocument.recipients.length - 10}
+
+ )}
+
)}
-
- )}
-
-
- )}
+
+ )}
- {/* Workflow Actions */}
-
-
Действия
- {
- loadDocuments();
- setSelectedDocument(null);
- }}
- />
-
+ {/* File Open Button - Show only when not fullscreen */}
+ {!isFullscreen && selectedDocument.file_url && (
+
+
+
+ )}
- {/* Acknowledgement */}
- {selectedDocument.acknowledgement_required && (
-
-
-
- Подтверждение прочтения
+ {/* Workflow Actions */}
+
+
+ Действия
-
+ />
- {
- loadDocuments();
- // Refresh selected document
- apiClient.getDocument(selectedDocument.id).then(setSelectedDocument);
- }}
- />
-
- )}
-
- {/* Right Column - Document Thumbnail */}
-
-
- {selectedDocument.file_url && (
-
-
-
- {/* Thumbnail Content */}
-
- {(() => {
- const fileExt = selectedDocument.file_name?.toLowerCase().split('.').pop() || '';
- const isImage = ['jpg', 'jpeg', 'png', 'gif', 'webp', 'svg', 'bmp'].includes(fileExt);
- const isPDF = fileExt === 'pdf';
-
- if (isImage) {
- return (
-

{
- // Fallback to icon on error
- e.currentTarget.style.display = 'none';
- }}
- />
- );
- }
-
- if (isPDF) {
- return (
-
-
-
- );
- }
-
- // Fallback for other file types
- return (
-
-
-
-
-
- {selectedDocument.file_name}
-
-
- {fileExt} файл
-
-
- );
- })()}
-
-
- {/* Quick Action Button */}
-
+ {/* Acknowledgement */}
+ {selectedDocument.acknowledgement_required && (
+
+
+
+ Подтверждение прочтения
+
-
- )}
-
- {/* No file placeholder */}
- {!selectedDocument.file_url && (
-
-
+
{
+ loadDocuments();
+ // Refresh selected document
+ apiClient
+ .getDocument(selectedDocument.id)
+ .then(setSelectedDocument);
+ }}
+ />
)}
+
+ {/* Right Column - Document Thumbnail (Only in fullscreen) */}
+ {isFullscreen && (
+
+
+ {selectedDocument.file_url && (
+
+
+
+ {/* Thumbnail Content */}
+
+ {(() => {
+ const fileExt =
+ selectedDocument.file_name
+ ?.toLowerCase()
+ .split(".")
+ .pop() || "";
+ const isImage = [
+ "jpg",
+ "jpeg",
+ "png",
+ "gif",
+ "webp",
+ "svg",
+ "bmp",
+ ].includes(fileExt);
+ const isPDF = fileExt === "pdf";
+
+ if (isImage) {
+ return (
+

{
+ // Fallback to icon on error
+ e.currentTarget.style.display = "none";
+ }}
+ />
+ );
+ }
+
+ if (isPDF) {
+ return (
+
+
+
+ );
+ }
+
+ // Fallback for other file types
+ return (
+
+
+
+
+
+ {selectedDocument.file_name}
+
+
+ {fileExt} файл
+
+
+ );
+ })()}
+
+
+ {/* Quick Action Button */}
+
+
+
+
+ )}
+
+ {/* No file placeholder */}
+ {!selectedDocument.file_url && (
+
+
+
+
+ Файл не прикреплен
+
+
+
+ )}
+
+
+ )}
-
- )}
+ )
+ }
{/* File Preview Modal */}
diff --git a/frontend/src/components/ui/Modal.tsx b/frontend/src/components/ui/Modal.tsx
index 3f020c42..1f5702dd 100644
--- a/frontend/src/components/ui/Modal.tsx
+++ b/frontend/src/components/ui/Modal.tsx
@@ -8,7 +8,7 @@ export interface ModalProps {
isOpen: boolean;
onClose: () => void;
title?: string;
- children: ReactNode;
+ children: ReactNode | ((isFullscreen: boolean) => ReactNode);
size?: "sm" | "md" | "lg" | "xl" | "full";
showCloseButton?: boolean;
closeOnClickOutside?: boolean;
@@ -173,7 +173,9 @@ export function Modal({
)}
{/* Content */}
-
{children}
+
+ {typeof children === "function" ? children(isFullscreen) : children}
+
{/* Footer */}
{footer && (