import { type ReactNode } from 'react';
import {
  AuthProvider,
  PermissionProvider,
  BrandingProvider,
  BreadcrumbProvider,
  UnitProvider,
  UserProvider,
} from '@tria-plc/iamui-common';

interface IamProvidersProps {
  children: ReactNode;
}

export function IamProviders({ children }: IamProvidersProps) {
  return (
    <AuthProvider>
      <BrandingProvider>
        <BreadcrumbProvider>
          <PermissionProvider>
            <UnitProvider>
              <UserProvider>
                {children}
              </UserProvider>
            </UnitProvider>
          </PermissionProvider>
        </BreadcrumbProvider>
      </BrandingProvider>
    </AuthProvider>
  );
}

export function AuthProviders({ children }: { children: ReactNode }) {
  return (
    <AuthProvider>
      <BrandingProvider>
        {children}
      </BrandingProvider>
    </AuthProvider>
  );
}
