-
Notifications
You must be signed in to change notification settings - Fork 183
Expand file tree
/
Copy pathFloatingRect.tsx
More file actions
44 lines (41 loc) · 1010 Bytes
/
Copy pathFloatingRect.tsx
File metadata and controls
44 lines (41 loc) · 1010 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import * as React from "react";
import classnames from "classnames";
import * as Types from "./types";
export type Props = {
variant?: string;
dimensions?: Types.Dimensions | null | undefined;
hidden?: boolean;
dragging?: boolean;
autoFilling?: boolean;
className?: string;
children?: React.ReactNode;
};
const FloatingRect: React.FC<Props> = ({
dimensions,
dragging,
autoFilling,
hidden,
variant,
className,
children,
}) => {
const { width, height, top, left } = dimensions || {};
return (
<div
className={classnames(
"Spreadsheet__floating-rect",
{
[`Spreadsheet__floating-rect--${variant}`]: variant,
"Spreadsheet__floating-rect--dragging": dragging,
"Spreadsheet__floating-rect--auto-filling": autoFilling,
"Spreadsheet__floating-rect--hidden": hidden,
},
className
)}
style={{ width, height, top, left }}
>
{children}
</div>
);
};
export default FloatingRect;