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