feat: disable Download button when no config is loaded

This commit is contained in:
sokol
2026-02-20 10:16:28 +03:00
parent 52232f6cde
commit 1b3f3b3110

View File

@@ -60,6 +60,8 @@ export function FileChooser({ onSelected, config }: FileChooserProps) {
URL.revokeObjectURL(url); URL.revokeObjectURL(url);
} }
const hasConfig = !!config;
return ( return (
<div className="bg-white rounded-xl shadow-md p-4 border border-slate-200"> <div className="bg-white rounded-xl shadow-md p-4 border border-slate-200">
<div className="flex items-center gap-4 flex-wrap"> <div className="flex items-center gap-4 flex-wrap">
@@ -89,8 +91,8 @@ export function FileChooser({ onSelected, config }: FileChooserProps) {
onClick={handleDownload} onClick={handleDownload}
icon={Download} icon={Download}
size="sm" size="sm"
disabled={!config} disabled={!hasConfig}
title="Download full config template" title={hasConfig ? 'Download full config template' : 'Load or create a config first'}
> >
Download Download
</Button> </Button>