feat: disable Download button when no config is loaded
This commit is contained in:
@@ -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>
|
||||||
|
|||||||
Reference in New Issue
Block a user