1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2026-03-22 17:04:12 -04:00
Files
Sonarr/frontend/src/Components/Form/FormInputButton.tsx
2024-11-26 17:37:21 -08:00

40 lines
928 B
TypeScript

import classNames from 'classnames';
import React from 'react';
import Button, { ButtonProps } from 'Components/Link/Button';
import SpinnerButton from 'Components/Link/SpinnerButton';
import { kinds } from 'Helpers/Props';
import styles from './FormInputButton.css';
export interface FormInputButtonProps extends ButtonProps {
canSpin?: boolean;
isLastButton?: boolean;
}
function FormInputButton({
className = styles.button,
canSpin = false,
isLastButton = true,
kind = kinds.PRIMARY,
...otherProps
}: FormInputButtonProps) {
if (canSpin) {
return (
<SpinnerButton
className={classNames(className, !isLastButton && styles.middleButton)}
kind={kind}
{...otherProps}
/>
);
}
return (
<Button
className={classNames(className, !isLastButton && styles.middleButton)}
kind={kind}
{...otherProps}
/>
);
}
export default FormInputButton;