/**
 * Copyright (c) 2023-present Plane Software, Inc. and contributors
 * SPDX-License-Identifier: AGPL-3.0-only
 * See the LICENSE file for details.
 */

import { observer } from "mobx-react";
// plane imports
import { PlaneLockup } from "@plane/propel/icons";
// hooks
import { useUser } from "@/hooks/store/user";
// local imports
import { SwitchAccountDropdown } from "./switch-account-dropdown";

export const OnboardingHeader = observer(function OnboardingHeader() {
  const { data: user } = useUser();

  const userName = user?.display_name
    ? user.display_name
    : user?.first_name
      ? `${user.first_name} ${user.last_name ?? ""}`.trim()
      : user?.email;

  return (
    <div className="sticky top-0 z-10 flex flex-col gap-4">
      <div className="h-1.5 w-full overflow-hidden rounded-t-lg bg-surface-1">
        <div className="h-full w-full bg-accent-primary" />
      </div>
      <div className="flex w-full items-center justify-between gap-6 px-6">
        <PlaneLockup height={20} width={95} className="text-primary" />
        <SwitchAccountDropdown fullName={userName} />
      </div>
    </div>
  );
});
