Files
DevToysWeb/components/page-section.tsx
rusconn 2741082c84 refactor!: refine spacings
BREAKING CAHNGE: some spaces changed
2024-03-29 20:47:21 +09:00

25 lines
582 B
TypeScript

import { cn } from "@/lib/style";
type Props = {
className?: string;
children: React.ReactNode;
title: string;
control?: React.ReactNode;
};
export function PageSection({ className, children, title, control }: Props) {
return (
<section className={cn("flex flex-col gap-1.5", className)}>
{control ? (
<div className="flex justify-between">
<h2 className="self-end text-base">{title}</h2>
<div>{control}</div>
</div>
) : (
<h2 className="text-base">{title}</h2>
)}
{children}
</section>
);
}