Files
Cli-Proxy-API-Management-Ce…/src/components/config/ConfigSection.tsx
T
Supra4E8C 5469945019 refactor: enhance ConfigPage styling and structure
- Updated SCSS for ConfigPage to improve layout and visual hierarchy.
- Introduced new styles for page header, including background gradients and responsive design.
- Refined tab bar and status badge styles for better user experience.
- Adjusted search input and actions for improved accessibility and usability.
- Enhanced editor wrapper and floating actions to prevent overlap with content.
- Cleaned up code structure in ConfigPage component for better readability and maintainability.
2026-03-22 17:10:17 +08:00

35 lines
1.3 KiB
TypeScript

import { forwardRef, type HTMLAttributes, type PropsWithChildren, type ReactNode } from 'react';
import styles from './ConfigSection.module.scss';
interface ConfigSectionProps extends Omit<HTMLAttributes<HTMLElement>, 'title'> {
title: ReactNode;
description?: ReactNode;
indexLabel?: ReactNode;
icon?: ReactNode;
}
export const ConfigSection = forwardRef<HTMLElement, PropsWithChildren<ConfigSectionProps>>(
function ConfigSection(
{ title, description, indexLabel, icon, className, children, ...rest },
ref
) {
const sectionClassName = [styles.section, className].filter(Boolean).join(' ');
return (
<section ref={ref} className={sectionClassName} {...rest}>
<header className={styles.header}>
<div className={styles.titleRow}>
{indexLabel ? <span className={styles.indexBadge}>{indexLabel}</span> : null}
{icon ? <span className={styles.iconBadge}>{icon}</span> : null}
</div>
<div className={styles.headingGroup}>
<h2 className={styles.title}>{title}</h2>
{description ? <p className={styles.description}>{description}</p> : null}
</div>
</header>
<div className={styles.content}>{children}</div>
</section>
);
}
);