// @design-system: layout/CustomerDesktopEnd
'use client';

import type { ReactNode } from 'react';
import { ProfileBadge } from '@/components/ui/layout/ProfileBadge';
import { LanguageToggle } from '@/components/ui/i18n/LanguageToggle';

export interface CustomerDesktopEndProps {
  /** True when no session exists. */
  isGuest?: boolean;
  /** True when the current user is an admin. */
  isAdmin?: boolean;
  /** True when the current user has an active vendor account. */
  isVendor?: boolean;
  /** True = show affiliate link in ProfileBadge. */
  isAffiliate?: boolean;
  /** User display name from SSR session. */
  userName?: string;
  /** Last 3 digits of phone — fallback label when no displayName. */
  phoneHint?: string;
  /** Optional extra content rendered after the ProfileBadge (e.g. CartNavButton). */
  extra?: ReactNode;
}

export function CustomerDesktopEnd({
  isGuest = false,
  isAdmin = false,
  isVendor = false,
  isAffiliate = false,
  userName,
  phoneHint,
  extra,
}: CustomerDesktopEndProps) {
  return (
    <>
      <LanguageToggle compact />
      <ProfileBadge
        isGuest={isGuest}
        isAdmin={isAdmin}
        isVendor={isVendor}
        isAffiliate={isAffiliate}
        userName={userName}
        phoneHint={phoneHint}
      />
      {extra}
    </>
  );
}
