import { isMobileLayout, useAdaptiveLayout } from '@cloud-ru/ds-adaptive'; import { DesktopActions } from '../Actions'; import { DesktopPageServices } from './DesktopPageServices'; import { MobilePageServices, MobilePageServicesProps } from './MobilePageServices'; import { DesktopPageServicesProps } from './types'; export type PageServicesProps = Omit & Pick; /** * Адаптивный `PageServices`: раскладку берёт из `AdaptiveProvider` (контекст). На `mobile` рендерит * `MobilePageServices` и передаёт `actions` структурированным массивом; на остальных раскладках * оборачивает `actions` в `DesktopActions` и отдаёт `DesktopPageServices` через слот `actions`. * Форс платформы — `withLayoutType` / вложенный ``; пропа * `layoutType` у компонента нет. */ export function PageServices({ actions, maxVisibleActionsItems, ...props }: PageServicesProps) { const { layoutType } = useAdaptiveLayout(); if (isMobileLayout(layoutType)) { return ; } const actionsNode = actions ? : undefined; return ; } PageServices.displayName = 'PageServices';