import type React from 'react'; import type { IconProps } from '@gravity-ui/uikit'; import type { SettingsSelection } from './Selection'; import type { SettingsPageSection } from './collect-settings'; interface GroupItem { groupTitle: string; items: Item[]; } export type SettingsMenuItemAriaProps = React.AriaAttributes & Pick, 'role'>; export interface Item { id: string; title: string; icon?: IconProps; disabled?: boolean; withBadge?: boolean; menuItemAriaProps?: SettingsMenuItemAriaProps; } type SettingsMenuItems = (GroupItem | Item)[]; export interface SettingsMenuProps { items: SettingsMenuItems; onChange: (id: string) => void; activeItemId?: string; focusItemId?: string; className?: string; } export type SettingsMenuMobileProps = Omit & { enableTabsScroll?: boolean; }; export interface SettingsProps { children: React.ReactNode; title?: string; filterPlaceholder?: string; emptyPlaceholder?: string; initialPage?: string; initialSearch?: string; selection?: SettingsSelection; onPageChange?: (page: string | undefined) => void; renderNotFound?: () => React.ReactNode; renderLoading?: () => React.ReactNode; loading?: boolean; view?: 'normal' | 'mobile'; onClose?: () => void; renderRightAdornment?: (item: SettingsItemProps) => React.ReactNode; renderSectionRightAdornment?: (section: SettingsPageSection) => React.ReactNode; showRightAdornmentOnHover?: boolean; enableMobileSettingsTabsScroll?: boolean; } export interface SettingsGroupProps { id?: string; groupTitle: string; children: React.ReactNode; } export interface SettingsPageProps { id?: string; title?: string; icon?: IconProps; children: React.ReactNode; /** Merged onto the left menu row in desktop Settings (`SettingsMenu`). */ menuItemAriaProps?: SettingsMenuItemAriaProps; } export interface SettingsSectionProps { id?: string; title: string; header?: React.ReactNode; children: React.ReactNode; withBadge?: boolean; hideTitle?: boolean; } export interface SettingsItemProps { id?: string; labelId?: string; title: string; highlightedTitle?: React.ReactNode | null; /** * Method to change rendering of title * When method returns null, whole label column is not rendered */ renderTitleComponent?: (highlightedTitle: React.ReactNode | null) => React.ReactNode; align?: 'top' | 'center'; children: React.ReactNode; withBadge?: boolean; mode?: 'row'; description?: React.ReactNode; } export type SettingsContentProps = Omit; export {};