'use client'; import { OrgProvider } from '@components/Contexts/OrgContext' import ErrorUI from '@components/Objects/StyledElements/Error/Error' import { useSearchParams } from 'next/navigation' import React from 'react' export default function AuthLayout({ children, }: { children: React.ReactNode }) { // Use optional chaining with proper typing to fix build error const searchParams = useSearchParams() // Type-safe approach to getting optional params const orgslug = searchParams ? searchParams.get('orgslug') : null if (orgslug) { return {children} } else { return } }