24 lines
485 B
TypeScript
24 lines
485 B
TypeScript
5 years ago
|
import "./Island.scss";
|
||
5 years ago
|
|
||
|
import React from "react";
|
||
4 years ago
|
import clsx from "clsx";
|
||
5 years ago
|
|
||
5 years ago
|
type IslandProps = {
|
||
|
children: React.ReactNode;
|
||
|
padding?: number;
|
||
5 years ago
|
className?: string | boolean;
|
||
5 years ago
|
style?: object;
|
||
5 years ago
|
};
|
||
5 years ago
|
|
||
5 years ago
|
export const Island = React.forwardRef<HTMLDivElement, IslandProps>(
|
||
5 years ago
|
({ children, padding, className, style }, ref) => (
|
||
5 years ago
|
<div
|
||
4 years ago
|
className={clsx("Island", className)}
|
||
4 years ago
|
style={{ "--padding": padding, ...style }}
|
||
5 years ago
|
ref={ref}
|
||
5 years ago
|
>
|
||
|
{children}
|
||
|
</div>
|
||
5 years ago
|
),
|
||
|
);
|