|
|
|
@ -1,10 +1,13 @@
|
|
|
|
|
import classNames from "classnames";
|
|
|
|
|
import { useContext } from "react";
|
|
|
|
|
|
|
|
|
|
import WidgetIcon from "./widget_icon";
|
|
|
|
|
import PrimaryText from "./primary_text";
|
|
|
|
|
import SecondaryText from "./secondary_text";
|
|
|
|
|
import Raw from "./raw";
|
|
|
|
|
|
|
|
|
|
import { SettingsContext } from "utils/contexts/settings";
|
|
|
|
|
|
|
|
|
|
export function getAllClasses(options, additionalClassNames = "") {
|
|
|
|
|
if (options?.style?.header === "boxedWidgets") {
|
|
|
|
|
if (options?.style?.cardBlur !== undefined) {
|
|
|
|
@ -56,7 +59,17 @@ export function getBottomBlock(children) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default function Container({ children = [], options, additionalClassNames = "" }) {
|
|
|
|
|
return (
|
|
|
|
|
const { settings } = useContext(SettingsContext);
|
|
|
|
|
return options.href ? (
|
|
|
|
|
<a
|
|
|
|
|
href={options.href}
|
|
|
|
|
target={options.target ?? settings.target ?? "_blank"}
|
|
|
|
|
className={getAllClasses(options, `${additionalClassNames} widget-container`)}
|
|
|
|
|
>
|
|
|
|
|
{getInnerBlock(children)}
|
|
|
|
|
{getBottomBlock(children)}
|
|
|
|
|
</a>
|
|
|
|
|
) : (
|
|
|
|
|
<div className={getAllClasses(options, `${additionalClassNames} widget-container`)}>
|
|
|
|
|
{getInnerBlock(children)}
|
|
|
|
|
{getBottomBlock(children)}
|
|
|
|
|