2025-06-24 00:04:36 -07:00
|
|
|
import clsx from 'clsx';
|
|
|
|
|
import { forwardRef, ReactNode, Ref } from 'react';
|
2023-07-23 12:23:18 +00:00
|
|
|
|
2025-06-24 00:04:36 -07:00
|
|
|
import styles from './remote-button.module.css';
|
|
|
|
|
|
|
|
|
|
import { Button, ButtonProps } from '/@/shared/components/button/button';
|
2025-05-20 19:23:36 -07:00
|
|
|
|
2025-06-24 00:04:36 -07:00
|
|
|
interface RemoteButtonProps extends ButtonProps {
|
2023-09-15 20:42:38 -07:00
|
|
|
children: ReactNode;
|
2025-06-24 00:04:36 -07:00
|
|
|
isActive?: boolean;
|
2023-07-23 12:23:18 +00:00
|
|
|
ref: Ref<HTMLButtonElement>;
|
|
|
|
|
}
|
|
|
|
|
|
2025-06-24 00:04:36 -07:00
|
|
|
export const RemoteButton = forwardRef<HTMLButtonElement, RemoteButtonProps>(
|
|
|
|
|
({ children, isActive, tooltip, ...props }, ref) => {
|
2023-07-23 12:23:18 +00:00
|
|
|
return (
|
2025-06-24 00:04:36 -07:00
|
|
|
<Button
|
|
|
|
|
className={clsx(styles.button, {
|
|
|
|
|
[styles.active]: isActive,
|
|
|
|
|
})}
|
|
|
|
|
tooltip={tooltip}
|
|
|
|
|
{...props}
|
|
|
|
|
ref={ref}
|
2023-07-23 12:23:18 +00:00
|
|
|
>
|
2025-06-24 00:04:36 -07:00
|
|
|
{children}
|
|
|
|
|
</Button>
|
2023-07-23 12:23:18 +00:00
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
);
|