UNPKG

@sinchsmb/ui-kit

Version:

UI kit for SinchSMB frontend

36 lines (35 loc) 1.17 kB
/// <reference types="react" /> import { CommonProps } from '../../types'; import { HeaderUserMenuAction } from './constants'; import { HeaderCompany, HeaderUser } from './types'; export interface HeaderProps extends CommonProps { /** List of available companies */ companies: HeaderCompany[]; /** ID of selected company */ currentCompanyId: string; /** Current user */ user: HeaderUser; /** Function that will be invoked when current company is changed */ onCurrentCompanyIdChange?: (companyId: string) => void; /** Function that will be invoked on clicking by some button in user menu */ onUserMenuActionClick?: (action: HeaderUserMenuAction) => void; } /** * Main header that should be used in application. * * ```tsx * import { Header, HeaderCompany, HeaderUser } from 'ui-kit'; * * const companies: HeaderCompany[] = [ * { label: 'SimpleTexting', id: 'ST' }, * { label: 'MessageMedia', id: 'MM' }, * ]; * * const user: HeaderUser = { * name: 'Ivan Ivanov' * }; * * <Header companies={companies} currentCompanyId="ST" user={user} /> * ``` */ export declare function Header(props: HeaderProps): JSX.Element;