import { ShoppingCart } from 'lucide-react';

import { Button } from '@kit/ui/button';
import { Trans } from '@kit/ui/trans';

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';

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

  return (
    <div className={'flex w-full flex-1 items-center justify-between gap-3'}>
      <div className={`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="outline">
          <ShoppingCart className="stroke-[1.5px]" />
          <Trans i18nKey="common:shoppingCart" /> (0)
        </Button>
        <UserNotifications userId={user.id} />

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