UNPKG

@lobehub/ui

Version:

Lobe UI is an open-source UI component library for building AIGC web apps

1 lines • 1.72 kB
{"version":3,"file":"ConsoleBrand.mjs","names":[],"sources":["../../../src/dashboard/ConsoleShell/ConsoleBrand.tsx"],"sourcesContent":["'use client';\n\nimport { useConsoleShellState } from './context';\nimport { styles } from './style';\nimport type { ConsoleBrandProps } from './type';\n\nfunction ConsoleBrand({ href = '/', label, logo, renderLink, title }: ConsoleBrandProps) {\n const shell = useConsoleShellState();\n const content =\n title == null || title === false || title === '' ? (\n logo\n ) : (\n <span className={styles.brandLockup}>\n {logo}\n <span className={styles.brandName}>{title}</span>\n </span>\n );\n const linkProps = {\n 'aria-label': label ?? (typeof title === 'string' ? title : 'Home'),\n 'children': content,\n 'className': styles.brandAnchor,\n href,\n 'onClick': () => shell?.closeNavigation(),\n };\n if (renderLink) return renderLink(linkProps);\n return (\n <a\n aria-label={linkProps['aria-label']}\n className={linkProps.className}\n href={href}\n onClick={linkProps.onClick}\n >\n {content}\n </a>\n );\n}\n\nConsoleBrand.displayName = 'ConsoleBrand';\n\nexport default ConsoleBrand;\n"],"mappings":";;;;;AAMA,SAAS,aAAa,EAAE,OAAO,KAAK,OAAO,MAAM,YAAY,SAA4B;CACvF,MAAM,QAAQ,qBAAqB;CACnC,MAAM,UACJ,SAAS,QAAQ,UAAU,SAAS,UAAU,KAC5C,OAEA,qBAAC,QAAD;EAAM,WAAW,OAAO;EAAxB,UAAA,CACG,MACD,oBAAC,QAAD;GAAM,WAAW,OAAO;GAAY,UAAA;EAAY,CAAA,CAC5C;;CAEV,MAAM,YAAY;EAChB,cAAc,UAAU,OAAO,UAAU,WAAW,QAAQ;EAC5D,YAAY;EACZ,aAAa,OAAO;EACpB;EACA,iBAAiB,OAAO,gBAAgB;CAC1C;CACA,IAAI,YAAY,OAAO,WAAW,SAAS;CAC3C,OACE,oBAAC,KAAD;EACE,cAAY,UAAU;EACtB,WAAW,UAAU;EACf;EACN,SAAS,UAAU;EAElB,UAAA;CACA,CAAA;AAEP;AAEA,aAAa,cAAc"}