UNPKG

@blocklet/ui-react

Version:

Some useful front-end web components that can be used in Blocklets.

43 lines (42 loc) 1.45 kB
import { default as React } from 'react'; import { Locale } from '@arcblock/ux/lib/type'; import { AppBadgeProps } from './app-badge'; export type NavItem = { id: string; parent: string; title: string; link: string; description?: string; }; export interface TabConfig { value: string; label?: string; render?: React.ComponentType | React.ReactNode; } export interface AppInfo { icon?: React.ReactNode; name?: React.ReactNode; description?: React.ReactNode; badges?: Array<AppBadgeProps | React.ReactElement>; actions?: React.ReactNode; tabs?: TabConfig[]; currentTab?: string; } export interface AppInfoContextValue extends AppInfo { inService: boolean; currentTab: string; TabComponent: React.ComponentType | React.ReactNode; navItem?: NavItem; updateAppInfo: (patch: Partial<AppInfo>) => void; } export declare const getI18nVal: (obj: Record<string, string | Record<Locale, string>>, key: string, locale?: Locale) => any; export declare const findNavItem: (items: NavItem[], targetLink?: string, locale?: Locale) => null; interface AppInfoProviderProps { path?: string; currentTab?: string; meta?: object; children?: React.ReactNode; } export declare function AppInfoProvider({ path, currentTab, meta, children, }: AppInfoProviderProps): import("react/jsx-runtime").JSX.Element; export declare function useAppInfo(): AppInfoContextValue; export {};