import { memo } from 'react'; import dynamic from 'next/dynamic'; import { SidebarContentsType } from '~/interfaces/ui'; import { useIsAiEnabled, useIsGuestUser } from '~/stores-universal/context'; import { useSidebarMode } from '~/stores/ui'; import { PrimaryItem } from './PrimaryItem'; import styles from './PrimaryItems.module.scss'; // Do not SSR Socket.io to make it work const PrimaryItemForNotification = dynamic( () => import('../InAppNotification/PrimaryItemForNotification').then(mod => mod.PrimaryItemForNotification), { ssr: false }, ); type Props = { onItemHover?: (contents: SidebarContentsType) => void, } export const PrimaryItems = memo((props: Props) => { const { onItemHover } = props; const { data: sidebarMode } = useSidebarMode(); const { data: isAiEnabled } = useIsAiEnabled(); const { data: isGuestUser } = useIsGuestUser(); if (sidebarMode == null) { return <>>; } return (