feat: Introduce cursor utility class for pointer interactions and refactor action buttons into PageHeaderActions component across multiple managers for improved UI consistency
Publish Fast Tabler Docker image / build-and-push-fast (push) Successful in 5m54s
Publish Fast Tabler Docker image / build-and-push-fast (push) Successful in 5m54s
This commit is contained in:
@@ -0,0 +1,74 @@
|
||||
import {
|
||||
IconEye,
|
||||
IconRefresh,
|
||||
IconUpload,
|
||||
IconDownload,
|
||||
IconDeviceFloppy
|
||||
} from '@tabler/icons-react';
|
||||
|
||||
function PageHeaderActions({
|
||||
loading = false,
|
||||
onPreview,
|
||||
disablePreview = false,
|
||||
onRefresh,
|
||||
disableRefresh = false,
|
||||
onImport,
|
||||
onExport,
|
||||
disableExport = false,
|
||||
onClear,
|
||||
disableClear = false,
|
||||
onSave,
|
||||
disableSave = false,
|
||||
onHistory,
|
||||
}) {
|
||||
return (
|
||||
<div className="btn-list">
|
||||
{onPreview && (
|
||||
<button className="btn btn-outline-secondary" onClick={onPreview} disabled={disablePreview} title="Предпросмотр изменений">
|
||||
<IconEye className="me-1" /> Предпросмотр
|
||||
</button>
|
||||
)}
|
||||
{onRefresh && (
|
||||
<button className="btn btn-outline-secondary" onClick={onRefresh} disabled={disableRefresh} title="Обновить данные">
|
||||
<IconRefresh className={loading ? 'spin me-1' : 'me-1'} /> Обновить
|
||||
</button>
|
||||
)}
|
||||
{onImport && (
|
||||
<button className="btn btn-outline-primary" onClick={onImport} title="Импорт">
|
||||
<IconUpload className="me-1" /> Импорт
|
||||
</button>
|
||||
)}
|
||||
{onExport && (
|
||||
<button className="btn btn-outline-primary" onClick={onExport} disabled={disableExport} title="Экспорт">
|
||||
<IconDownload className="me-1" /> Экспорт
|
||||
</button>
|
||||
)}
|
||||
{onClear && (
|
||||
<button className="btn btn-outline-secondary" onClick={onClear} disabled={disableClear} title="Очистить пустые/невалидные">
|
||||
Очистить
|
||||
</button>
|
||||
)}
|
||||
{onSave && (
|
||||
<button className="btn btn-primary" onClick={onSave} disabled={disableSave} title="Сохранить">
|
||||
{loading ? (
|
||||
<>
|
||||
<span className="spinner-border spinner-border-sm me-2" role="status"></span>
|
||||
Сохранение...
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<IconDeviceFloppy className="me-1" /> Сохранить
|
||||
</>
|
||||
)}
|
||||
</button>
|
||||
)}
|
||||
{onHistory && (
|
||||
<button className="btn btn-outline-secondary" onClick={onHistory} title="История версий">История</button>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default PageHeaderActions;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user