mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-07 12:30:12 +02:00
c1330d92b2
* mantine v8 migration * various design changes and improvements
30 lines
798 B
TypeScript
30 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>
|
|
);
|
|
},
|
|
);
|