mirror of
https://github.com/khairul169/vaulterm.git
synced 2025-06-17 17:19:37 +07:00
20 lines
460 B
TypeScript
20 lines
460 B
TypeScript
|
import React from "react";
|
||
|
import { GetProps, Button as BaseButton, Spinner } from "tamagui";
|
||
|
|
||
|
type ButtonProps = GetProps<typeof BaseButton> & {
|
||
|
isDisabled?: boolean;
|
||
|
isLoading?: boolean;
|
||
|
};
|
||
|
|
||
|
const Button = ({ icon, isLoading, isDisabled, ...props }: ButtonProps) => {
|
||
|
return (
|
||
|
<BaseButton
|
||
|
icon={isLoading ? <Spinner /> : icon}
|
||
|
disabled={isLoading || isDisabled || props.disabled}
|
||
|
{...props}
|
||
|
/>
|
||
|
);
|
||
|
};
|
||
|
|
||
|
export default Button;
|