summaryrefslogtreecommitdiffstats
path: root/packages/excalidraw/components/Island.tsx
blob: 7baf307a06bcd63ecc1136298ff9dc2fdf8357b4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import "./Island.scss";

import React from "react";
import clsx from "clsx";

type IslandProps = {
  children: React.ReactNode;
  padding?: number;
  className?: string | boolean;
  style?: object;
};

export const Island = React.forwardRef<HTMLDivElement, IslandProps>(
  ({ children, padding, className, style }, ref) => (
    <div
      className={clsx("Island", className)}
      style={{ "--padding": padding, ...style }}
      ref={ref}
    >
      {children}
    </div>
  ),
);