refactor: remove React.FC for component package (#3575)

This commit is contained in:
Garfield Lee
2023-08-04 23:00:28 +08:00
committed by GitHub
parent 7ec4b8fb8c
commit 65fc0ed59c
21 changed files with 165 additions and 149 deletions
@@ -1,26 +1,27 @@
import { clsx } from 'clsx';
import type {
FC,
HTMLAttributes,
PropsWithChildren,
ReactElement,
ReactNode,
} from 'react';
import { AppSidebarFallback } from '../app-sidebar';
import { appStyle, mainContainerStyle, toolStyle } from './index.css';
export type WorkspaceRootProps = PropsWithChildren<{
export interface WorkspaceRootProps {
resizing?: boolean;
useNoisyBackground?: boolean;
useBlurBackground?: boolean;
}>;
children: ReactNode;
}
export const AppContainer: FC<WorkspaceRootProps> = ({
export const AppContainer = ({
resizing,
useNoisyBackground,
useBlurBackground,
children,
}) => {
}: WorkspaceRootProps) => {
const noisyBackground = useNoisyBackground && environment.isDesktop;
return (
<div
@@ -36,18 +37,17 @@ export const AppContainer: FC<WorkspaceRootProps> = ({
);
};
export type MainContainerProps = PropsWithChildren<{
export interface MainContainerProps extends HTMLAttributes<HTMLDivElement> {
className?: string;
padding?: boolean;
}> &
HTMLAttributes<HTMLDivElement>;
}
export const MainContainer = ({
className,
padding,
children,
...props
}: MainContainerProps): ReactElement => {
}: PropsWithChildren<MainContainerProps>): ReactElement => {
return (
<div
{...props}