aboutsummaryrefslogtreecommitdiff
path: root/components/ViewPort/index.tsx
blob: 08b4c7eb6df0fcf2aab7979aac811b1dee9b308c (plain)
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
import React, { FC } from "react"
import styles from './index.module.scss';
import { getSystemStyle, SystemProps } from '../utils/systemProps';
import clsx from 'clsx';

interface Props extends SystemProps {
  size?: "sm" | "md" | "lg";
  className?: string;
  children?: React.ReactNode;
  style?: React.CSSProperties;
};

const Viewport : FC<Props> = ({children, className, style, size, ...systemProps}) => {
  style = getSystemStyle(systemProps, style);

  const _size : string = size || "md";
  const sizeClass : string = styles['viewport-' + _size];

  return (
    <div
        className={clsx(sizeClass, className)}
        style={style}
    >
      {children}
    </div>
  )
};

export default Viewport;