@itwin/itwinui-react
Version:
A react component library for iTwinUI
47 lines (46 loc) • 1 kB
JavaScript
import cx from 'classnames';
import * as React from 'react';
import { Box } from '../../utils/index.js';
export const HeaderLogo = React.forwardRef((props, ref) => {
let {
className,
children,
logo,
onClick,
as = !!onClick ? 'button' : 'div',
...rest
} = props;
return React.createElement(
Box,
{
className: cx('iui-header-brand', className),
as: as,
type: 'button' === as ? 'button' : void 0,
onClick: onClick,
ref: ref,
...rest,
},
logo
? React.createElement(
Box,
{
as: 'span',
className: 'iui-header-brand-icon',
'aria-hidden': true,
},
logo,
)
: null,
children &&
React.createElement(
Box,
{
as: 'span',
className: 'iui-header-brand-label',
},
children,
),
);
});
if ('development' === process.env.NODE_ENV)
HeaderLogo.displayName = 'HeaderLogo';