2023-03-01 09:39:41 -06:00
|
|
|
/**
|
|
|
|
|
* Copyright (c) HashiCorp, Inc.
|
2024-05-31 11:29:24 -07:00
|
|
|
* SPDX-License-Identifier: BUSL-1.1
|
2023-03-01 09:39:41 -06:00
|
|
|
*/
|
|
|
|
|
|
2022-04-28 17:49:03 -04:00
|
|
|
import Component from '@glimmer/component';
|
2025-03-06 12:20:48 -08:00
|
|
|
import { dropTask, timeout } from 'ember-concurrency';
|
2022-04-28 15:35:46 -05:00
|
|
|
|
2022-04-28 17:49:03 -04:00
|
|
|
export default class LoadingButton extends Component {
|
2025-03-06 12:20:48 -08:00
|
|
|
// =attributes
|
2022-04-28 08:49:37 -07:00
|
|
|
|
2025-03-06 12:20:48 -08:00
|
|
|
toggleRefresh = dropTask(async () => {
|
|
|
|
|
await this.args.onClick();
|
|
|
|
|
await timeout(1000);
|
|
|
|
|
});
|
2022-04-28 08:49:37 -07:00
|
|
|
}
|