mirror of
https://github.com/gethomepage/homepage.git
synced 2026-09-15 08:35:49 -07:00
81accd8dbe
Lint / Linting Checks (push) Has been cancelled
Release Drafter / Update Release Draft (push) Has been cancelled
Docker CI / Docker Build & Push (push) Has been cancelled
Tests / vitest (1) (push) Has been cancelled
Tests / vitest (2) (push) Has been cancelled
Release Drafter / Auto Label PR (push) Has been cancelled
Tests / vitest (3) (push) Has been cancelled
Tests / vitest (4) (push) Has been cancelled
Co-authored-by: shamoon <4887959+shamoon@users.noreply.github.com> Signed-off-by: dependabot[bot] <support@github.com>
29 lines
850 B
React
29 lines
850 B
React
import classNames from "classnames";
|
|
import { useContext } from "react";
|
|
|
|
import Error from "./error";
|
|
|
|
import { SettingsContext } from "utils/contexts/settings";
|
|
|
|
export default function Container({ children, widget, error = null, chart = true, className = "" }) {
|
|
const { settings } = useContext(SettingsContext);
|
|
const hideErrors = settings.hideErrors || widget?.hideErrors;
|
|
|
|
if (error) {
|
|
if (hideErrors) {
|
|
return null;
|
|
}
|
|
|
|
return <Error />;
|
|
}
|
|
|
|
return (
|
|
<div className={classNames("service-container", chart ? "chart relative h-[68px]" : "")}>
|
|
{children}
|
|
<div className={`absolute -top-10 right-0 bottom-0 left-0 overflow-clip pointer-events-none ${className}`} />
|
|
{chart && <div className="h-[68px] overflow-clip" />}
|
|
{!chart && <div className="h-[16px] overflow-clip" />}
|
|
</div>
|
|
);
|
|
}
|