34 lines
739 B
TypeScript
34 lines
739 B
TypeScript
import { ReactNode } from "react";
|
|
|
|
type SettingsSectionProps = {
|
|
icon?: ReactNode;
|
|
title: string;
|
|
description?: string;
|
|
action?: ReactNode;
|
|
children: ReactNode;
|
|
};
|
|
|
|
export function SettingsSection({
|
|
icon,
|
|
title,
|
|
description,
|
|
action,
|
|
children,
|
|
}: SettingsSectionProps) {
|
|
return (
|
|
<section className="space-y-4">
|
|
<div className="flex items-start justify-between">
|
|
<div>
|
|
<h3 className="text-lg font-semibold flex items-center gap-2">
|
|
{icon}
|
|
{title}
|
|
</h3>
|
|
{description && <p className="text-sm text-muted-foreground mt-1">{description}</p>}
|
|
</div>
|
|
{action && <div>{action}</div>}
|
|
</div>
|
|
{children}
|
|
</section>
|
|
);
|
|
}
|