"use client"

/**
 * RBAC module error boundary.
 *
 * 薄包装：委托给共享 SectionErrorBoundary，使用 common 命名空间。
 * 保留同名导出以兼容现有 import。
 */

import type { ReactNode } from "react"
import { SectionErrorBoundary } from "@/shared/components/section-error-boundary"

interface ErrorBoundaryProps {
  children: ReactNode
  fallback?: ReactNode
}

export function ErrorBoundary({ children, fallback }: ErrorBoundaryProps): ReactNode {
  return (
    <SectionErrorBoundary
      namespace="common"
      fallback={fallback ? () => fallback : undefined}
    >
      {children}
    </SectionErrorBoundary>
  )
}
