You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1234567891011121314151617181920212223242526272829
  1. import type { ComponentProps, FC, ReactNode } from 'react'
  2. import classNames from '@/utils/classnames'
  3. export type PreviewContainerProps = ComponentProps<'div'> & {
  4. header: ReactNode
  5. mainClassName?: string
  6. ref?: React.Ref<HTMLDivElement>
  7. }
  8. export const PreviewContainer: FC<PreviewContainerProps> = (props) => {
  9. const { children, className, header, mainClassName, ref, ...rest } = props
  10. return <div className={className}>
  11. <div
  12. {...rest}
  13. ref={ref}
  14. className={classNames(
  15. 'flex h-full w-full flex-col overflow-y-auto rounded-l-xl border-l-[0.5px] border-t-[0.5px] border-components-panel-border bg-background-default-lighter shadow shadow-shadow-shadow-5',
  16. )}
  17. >
  18. <header className='border-b border-divider-subtle pb-3 pl-5 pr-4 pt-4'>
  19. {header}
  20. </header>
  21. <main className={classNames('h-full w-full px-6 py-5', mainClassName)}>
  22. {children}
  23. </main>
  24. </div>
  25. </div>
  26. }
  27. PreviewContainer.displayName = 'PreviewContainer'