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',
|
|
|
|
timeout = 0
|
2023-02-14 08:19:41 +00:00
|
|
|
): ButtonOptions<true> {
|
2023-03-03 20:13:37 +00:00
|
|
|
return { label, color, value: true, timeout };
|
2023-02-14 08:19:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export function buildCancelButton(label = 'Cancel'): ButtonOptions<false> {
|
|
|
|
return {
|
|
|
|
label,
|
|
|
|
color: 'default',
|
|
|
|
value: false,
|
|
|
|
};
|
|
|
|
}
|