
import { Trans } from '@kit/ui/trans';
import { cn } from '@kit/ui/utils';

import { AppLogo } from '~/components/app-logo';
import { ProfileAccountDropdownContainer } from '~/components/personal-account-dropdown-container';
import { Search } from '~/components/ui/search';

import { SIDEBAR_WIDTH } from '../../../../packages/ui/src/shadcn/constants';
// home imports
import { UserNotifications } from '../_components/user-notifications';
import { type UserWorkspace } from '../_lib/server/load-user-workspace';
import { Button } from '@kit/ui/button';
import { ShoppingCart } from 'lucide-react';

export function HomeMenuNavigation(props: { workspace: UserWorkspace }) {
  const { workspace, user, accounts } = props.workspace;

  return (
    <div className={'flex w-full flex-1 items-center justify-between gap-3'}>
      <div className={cn('flex items-center', `w-[${SIDEBAR_WIDTH}]`)}>
        <AppLogo />

      </div>
      <Search
        className="flex grow"
        startElement={<Trans i18nKey="common:search" values={{ end: '...' }} />}
      />

      <div className="flex items-center justify-end gap-3">
        <Button variant="ghost">
          <ShoppingCart className="stroke-[1.5px]" />
          <Trans i18nKey="common:shoppingCart" /> (0)
        </Button>
        <UserNotifications userId={user.id} />

        <div>
          <ProfileAccountDropdownContainer
            user={user}
            account={workspace}
            showProfileName
            accounts={accounts}
          />
        </div>
      </div>
    </div>
  );
}
