mirror of
https://github.com/jeffvli/feishin.git
synced 2026-07-07 02:59:57 +02:00
c1330d92b2
* mantine v8 migration * various design changes and improvements
26 lines
753 B
TypeScript
26 lines
753 B
TypeScript
import clsx from 'clsx';
|
|
import { forwardRef, HTMLAttributes } from 'react';
|
|
|
|
import styles from './resize-handle.module.css';
|
|
|
|
interface ResizeHandleProps extends HTMLAttributes<HTMLDivElement> {
|
|
isResizing: boolean;
|
|
placement: 'bottom' | 'left' | 'right' | 'top';
|
|
}
|
|
|
|
export const ResizeHandle = forwardRef<HTMLDivElement, ResizeHandleProps>(
|
|
({ isResizing, placement, ...props }: ResizeHandleProps, ref) => {
|
|
return (
|
|
<div
|
|
className={clsx({
|
|
[styles.handle]: true,
|
|
[styles.resizing]: isResizing,
|
|
[styles[`handle-${placement}`]]: true,
|
|
})}
|
|
ref={ref}
|
|
{...props}
|
|
/>
|
|
);
|
|
},
|
|
);
|