mirror of
https://github.com/antebudimir/feishin.git
synced 2025-12-31 10:03:33 +00:00
29 lines
798 B
TypeScript
29 lines
798 B
TypeScript
import clsx from 'clsx';
|
|
import { forwardRef, ReactNode, Ref } from 'react';
|
|
|
|
import styles from './remote-button.module.css';
|
|
|
|
import { Button, ButtonProps } from '/@/shared/components/button/button';
|
|
|
|
interface RemoteButtonProps extends ButtonProps {
|
|
children: ReactNode;
|
|
isActive?: boolean;
|
|
ref: Ref<HTMLButtonElement>;
|
|
}
|
|
|
|
export const RemoteButton = forwardRef<HTMLButtonElement, RemoteButtonProps>(
|
|
({ children, isActive, tooltip, ...props }, ref) => {
|
|
return (
|
|
<Button
|
|
className={clsx(styles.button, {
|
|
[styles.active]: isActive,
|
|
})}
|
|
tooltip={tooltip}
|
|
{...props}
|
|
ref={ref}
|
|
>
|
|
{children}
|
|
</Button>
|
|
);
|
|
},
|
|
);
|