feat: Удаление устаревших файлов документации и оптимизация структуры проекта. Упрощение кода и улучшение читаемости за счет удаления ненужных компонентов и отчетов, что способствует более эффективному управлению проектом.
Publish Fast Tabler Docker image / build-and-push-fast (push) Successful in 1m34s
Publish Fast Tabler Docker image / build-and-push-fast (push) Successful in 1m34s
This commit is contained in:
@@ -1,7 +1,12 @@
|
||||
import { IconAlertTriangle, IconX } from '@tabler/icons-react';
|
||||
import { IconAlertTriangle } from '@tabler/icons-react';
|
||||
|
||||
/**
|
||||
* ErrorAlert - компонент для отображения ошибок
|
||||
* Оптимизирован: убрано дублирование кода
|
||||
*/
|
||||
function ErrorAlert({ message, details, onClose }) {
|
||||
if (!message) return null;
|
||||
|
||||
return (
|
||||
<div className="alert alert-danger alert-dismissible" role="alert">
|
||||
<div className="d-flex">
|
||||
@@ -10,24 +15,26 @@ function ErrorAlert({ message, details, onClose }) {
|
||||
</div>
|
||||
<div className="flex-grow-1">
|
||||
{String(message)}
|
||||
{details ? (
|
||||
{details && (
|
||||
<details className="small mt-1">
|
||||
<summary>Показать детали</summary>
|
||||
<pre className="mb-0 mt-1" style={{ whiteSpace: 'pre-wrap' }}>
|
||||
{typeof details === 'string' ? details : JSON.stringify(details, null, 2)}
|
||||
</pre>
|
||||
</details>
|
||||
) : null}
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
<button type="button" className="btn-close" onClick={onClose} aria-label="Закрыть">
|
||||
<IconX size={16} />
|
||||
</button>
|
||||
{onClose && (
|
||||
<button
|
||||
type="button"
|
||||
className="btn-close"
|
||||
onClick={onClose}
|
||||
aria-label="Закрыть"
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default ErrorAlert;
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user