import React, { type ComponentPropsWithoutRef, type ComponentPropsWithRef, type FC, type ReactNode } from 'react'; import { GrSystem } from 'react-icons/gr'; import type { BuildInfo } from '../../buildinfo'; import { getBuildInfo } from '../../buildinfo'; import { cn } from '../../utils/cn'; import { resolveWithDefault } from '../../utils/resolveWithDefault'; import { SystemAboutPageAuthorInfo, type SystemAboutPageAuthorInfoProps } from './SystemAboutPageAuthorInfo'; import { SystemAboutPageBrowserInfo } from './SystemAboutPageBrowserInfo'; import { SystemAboutPageBuildInfo, type SystemAboutPageBuildInfoProps } from './SystemAboutPageBuildInfo'; import { SystemAboutPageSection } from './SystemAboutPageSection'; export namespace SystemAboutPage { export type CompositeProps = ComponentPropsWithRef<'div'> & { children?: ReactNode; build?: boolean | (Omit & { info?: BuildInfo }); author?: boolean | SystemAboutPageAuthorInfoProps; agent?: boolean | ReactNode; }; export const Layout: FC> = ({ children, className, ...props }) => { return (
{children}
); }; export const Composite: FC = ({ children, build, author, agent, ...props }) => { const buildProps = resolveWithDefault(build, { title: '控制台', logo: , info: getBuildInfo(), }); const authorProps = resolveWithDefault(author, {}); const agentNode = resolveWithDefault(agent, ); return ( {buildProps && } {authorProps && } {agentNode} {children} ); }; export const AuthorInfo = SystemAboutPageAuthorInfo; export const BuildInfo = SystemAboutPageBuildInfo; export const BrowserInfo = SystemAboutPageBrowserInfo; export const Section = SystemAboutPageSection; }