sendou.ink/app/components/Main.tsx
Kalle 6e987d506f
Some checks are pending
E2E Tests / e2e (push) Waiting to run
Tests and checks on push / run-checks-and-tests (push) Waiting to run
Updates translation progress / update-translation-progress-issue (push) Waiting to run
Tournament layout refresh, improve admin experience (#3152)
2026-06-11 18:31:10 +03:00

60 lines
1.0 KiB
TypeScript

import clsx from "clsx";
import type * as React from "react";
import styles from "./Main.module.css";
export const Main = ({
children,
className,
classNameOverwrite,
halfWidth,
bigger,
breakoutContainer,
style,
}: {
children: React.ReactNode;
className?: string;
classNameOverwrite?: string;
halfWidth?: boolean;
bigger?: boolean;
breakoutContainer?: boolean;
style?: React.CSSProperties;
}) => {
return (
<main
className={
classNameOverwrite
? clsx(classNameOverwrite, {
[styles.narrow]: halfWidth,
})
: clsx(
styles.main,
styles.normal,
{
[styles.narrow]: halfWidth,
[styles.wide]: bigger,
},
className,
)
}
data-main-breakout={breakoutContainer || undefined}
style={style}
>
{children}
</main>
);
};
export { styles as mainStyles };
export const containerClassName = (width: "narrow" | "normal" | "wide") => {
if (width === "narrow") {
return styles.narrow;
}
if (width === "wide") {
return styles.wide;
}
return styles.normal;
};