2023-02-14 08:19:41 +00:00
|
|
|
import { ComponentProps } from 'react';
|
|
|
|
|
|
|
|
import { Button } from '@@/buttons';
|
|
|
|
|
|
|
|
import { ButtonOptions } from './types';
|
|
|
|
|
|
|
|
export function buildConfirmButton(
|
|
|
|
label = 'Confirm',
|
2023-03-03 20:13:37 +00:00
|
|
|
color: ComponentProps<typeof Button>['color'] = 'primary',
|
2024-04-11 00:11:38 +00:00
|
|
|
timeout = 0,
|
|
|
|
dataCy = 'modal-confirm-button'
|
2023-02-14 08:19:41 +00:00
|
|
|
): ButtonOptions<true> {
|
2024-04-11 00:11:38 +00:00
|
|
|
return { label, color, value: true, timeout, dataCy };
|
2023-02-14 08:19:41 +00:00
|
|
|
}
|
|
|
|
|
2024-04-11 00:11:38 +00:00
|
|
|
export function buildCancelButton(
|
|
|
|
label = 'Cancel',
|
|
|
|
dataCy = 'modal-cancel-button'
|
|
|
|
): ButtonOptions<false> {
|
2023-02-14 08:19:41 +00:00
|
|
|
return {
|
|
|
|
label,
|
|
|
|
color: 'default',
|
|
|
|
value: false,
|
2024-04-11 00:11:38 +00:00
|
|
|
dataCy,
|
2023-02-14 08:19:41 +00:00
|
|
|
};
|
|
|
|
}
|