'use server';

import { getProfile } from '@/lib/actions';
import AvatarDropdown from './AvatarDropdown';
import { SignInSignUp } from '@/components/default/auth';

const NavigationAuth = async () => {
  try {
    const profile = await getProfile();
    return profile.success ? (
      <div className='flex items-center gap-4'>
        <AvatarDropdown />
      </div>
    ) : (
      <SignInSignUp />
    );
  } catch (error) {
    console.error(`Error getting profile: ${error as string}`);
    return <SignInSignUp />;
  }
};
export default NavigationAuth;
