1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-19 21:39:40 +02:00
portainer/app/react/components/modals/utils.ts

21 lines
475 B
TypeScript

import { ComponentProps } from 'react';
import { Button } from '@@/buttons';
import { ButtonOptions } from './types';
export function buildConfirmButton(
label = 'Confirm',
color: ComponentProps<typeof Button>['color'] = 'primary',
timeout = 0
): ButtonOptions<true> {
return { label, color, value: true, timeout };
}
export function buildCancelButton(label = 'Cancel'): ButtonOptions<false> {
return {
label,
color: 'default',
value: false,
};
}