import * as React from 'react'
import { Slot } from 'radix-ui'

import { cn } from '@/shared/lib/utils'

function PageContainer({
  asChild = false,
  className,
  ...props
}: React.ComponentProps<'div'> & { asChild?: boolean }) {
  const Comp = asChild ? Slot.Root : 'div'
  return (
    <Comp
      data-slot="page-container"
      className={cn('mx-auto w-full max-w-7xl px-6', className)}
      {...props}
    />
  )
}

export { PageContainer }
