2024-01-31 14:21:29 +00:00
|
|
|
import classNames from 'classnames';
|
|
|
|
import { type HTMLAttributes } from 'react';
|
|
|
|
|
|
|
|
export const BORDER_COLOR = 'border-vega-clight-500 dark:border-vega-cdark-500';
|
|
|
|
export const GRADIENT =
|
|
|
|
'bg-gradient-to-b from-vega-clight-800 dark:from-vega-cdark-800 to-transparent';
|
|
|
|
|
2024-02-02 18:07:06 +00:00
|
|
|
export const Box = ({
|
|
|
|
children,
|
|
|
|
backgroundImage,
|
|
|
|
...props
|
|
|
|
}: HTMLAttributes<HTMLDivElement> & { backgroundImage?: string }) => {
|
2024-01-31 14:21:29 +00:00
|
|
|
return (
|
|
|
|
<div
|
|
|
|
{...props}
|
|
|
|
className={classNames(
|
|
|
|
BORDER_COLOR,
|
|
|
|
GRADIENT,
|
|
|
|
'border rounded-lg',
|
2024-02-02 18:07:06 +00:00
|
|
|
'relative p-6 overflow-hidden',
|
2024-01-31 14:21:29 +00:00
|
|
|
props.className
|
|
|
|
)}
|
2024-02-02 18:07:06 +00:00
|
|
|
>
|
|
|
|
{Boolean(backgroundImage?.length) && (
|
|
|
|
<div
|
|
|
|
className={classNames(
|
|
|
|
'pointer-events-none',
|
|
|
|
'bg-no-repeat bg-center bg-[length:500px_500px]',
|
|
|
|
'absolute top-0 left-0 w-full h-full -z-10 opacity-30 blur-lg'
|
|
|
|
)}
|
|
|
|
style={{ backgroundImage: `url("${backgroundImage}")` }}
|
|
|
|
></div>
|
|
|
|
)}
|
|
|
|
|
|
|
|
{children}
|
|
|
|
</div>
|
2024-01-31 14:21:29 +00:00
|
|
|
);
|
|
|
|
};
|