mirror of
https://github.com/router-for-me/Cli-Proxy-API-Management-Center.git
synced 2026-06-16 21:03:58 +08:00
- 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.
35 lines
1.3 KiB
TypeScript
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>
|
|
);
|
|
}
|
|
);
|