mirror of
https://github.com/QuivrHQ/quivr.git
synced 2024-12-22 22:01:41 +03:00
0d70ad4362
Issue: https://github.com/StanGirard/quivr/issues/1424 https://github.com/StanGirard/quivr/assets/63923024/a64b7456-6efc-40e6-9f0a-89552a372e0a
44 lines
1.1 KiB
TypeScript
44 lines
1.1 KiB
TypeScript
import { cn } from "@/lib/utils";
|
|
|
|
import styles from "./HomeSection.module.css";
|
|
|
|
type HomeSectionProps = {
|
|
bg: string;
|
|
slantCurrent?: "up" | "down" | "none";
|
|
slantBefore?: "up" | "down" | "none";
|
|
slantAfter?: "up" | "down" | "none";
|
|
hiddenOnMobile?: boolean;
|
|
children: React.ReactNode;
|
|
className?: string;
|
|
};
|
|
|
|
export const HomeSection = ({
|
|
bg,
|
|
slantCurrent = "none",
|
|
slantBefore = "none",
|
|
slantAfter = "none",
|
|
hiddenOnMobile = false,
|
|
className,
|
|
children,
|
|
}: HomeSectionProps): JSX.Element => {
|
|
const slantBeforeFix = styles[`slant-before-is-${slantBefore}`] ?? "";
|
|
const slantAfterFix = styles[`slant-after-is-${slantAfter}`] ?? "";
|
|
const flex = hiddenOnMobile
|
|
? "hidden md:flex md:justify-center"
|
|
: "flex justify-center";
|
|
const slant = styles[`section-slanted-${slantCurrent}wards`] ?? "";
|
|
|
|
return (
|
|
<div
|
|
className={cn(
|
|
`${bg} w-screen ${flex} ${slantBeforeFix} ${slantAfterFix} ${slant}`,
|
|
className
|
|
)}
|
|
>
|
|
<section className="flex flex-col items-center w-full max-w-6xl z-[2] py-8">
|
|
{children}
|
|
</section>
|
|
</div>
|
|
);
|
|
};
|