mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Add disabled prop to DownloadLogsDropdown
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
parent
1e69ea9b27
commit
d12b4241a0
@ -63,6 +63,7 @@ export const LogControls = observer(({ model }: LogControlsProps) => {
|
||||
/>
|
||||
|
||||
<DownloadLogsDropdown
|
||||
disabled={logs.length === 0}
|
||||
downloadVisibleLogs={model.downloadLogs}
|
||||
downloadAllLogs={model.downloadAllLogs}
|
||||
/>
|
||||
|
||||
@ -13,9 +13,10 @@ import { Dropdown } from "../../dropdown/dropdown";
|
||||
interface DownloadLogsDropdownProps {
|
||||
downloadVisibleLogs: () => void;
|
||||
downloadAllLogs: () => Promise<void> | undefined;
|
||||
disabled?: boolean;
|
||||
}
|
||||
|
||||
export function DownloadLogsDropdown({ downloadAllLogs, downloadVisibleLogs }: DownloadLogsDropdownProps) {
|
||||
export function DownloadLogsDropdown({ downloadAllLogs, downloadVisibleLogs, disabled }: DownloadLogsDropdownProps) {
|
||||
const [waiting, setWaiting] = useState(false);
|
||||
|
||||
const downloadAll = async () => {
|
||||
@ -35,7 +36,7 @@ export function DownloadLogsDropdown({ downloadAllLogs, downloadVisibleLogs }: D
|
||||
<button
|
||||
data-testid="download-logs-dropdown"
|
||||
className={styles.dropdown}
|
||||
disabled={waiting}
|
||||
disabled={waiting || disabled}
|
||||
>
|
||||
Download
|
||||
<Icon material="arrow_drop_down" smallest/>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user