Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

988 B
Raw Blame
'use client';

import { cssVar, Flexbox, type FlexboxProps } from '@lobehub/ui';
import { memo, type PropsWithChildren, type ReactNode } from 'react';

interface WorkspaceSettingsContainerProps extends FlexboxProps {
  addonAfter?: ReactNode;
  addonBefore?: ReactNode;
  maxWidth?: number | string;
}

const WorkspaceSettingsContainer = memo<PropsWithChildren<WorkspaceSettingsContainerProps>>(
  ({ maxWidth = 1024, children, addonAfter, addonBefore, style, ...rest }) => {
    return (
      <Flexbox
        align={'center'}
        height={'100%'}
        width={'100%'}
        style={{
          background: cssVar.colorBgContainer,
          overflowX: 'hidden',
          overflowY: 'auto',
          ...style,
        }}
        {...rest}
      >
        {addonBefore}
        <Flexbox flex={1} gap={36} style={{ maxWidth }} width={'100%'}>
          {children}
        </Flexbox>
        {addonAfter}
      </Flexbox>
    );
  },
);

export default WorkspaceSettingsContainer;