Files
automatisch/packages/web/src/components/Logo/index.tsx
Rıdvan Akca a3b3038709 test(user-interface-configuration): write initial tests (#1242)
* test(user-interface): add tests with playwright

* test: refactor UI configuration tests

---------

Co-authored-by: Ali BARIN <ali.barin53@gmail.com>
2023-08-25 21:31:02 +02:00

24 lines
652 B
TypeScript

import Typography from '@mui/material/Typography';
import * as React from 'react';
import { FormattedMessage } from 'react-intl';
import CustomLogo from 'components/CustomLogo/index.ee';
import useConfig from 'hooks/useConfig';
const Logo = () => {
const { config, loading } = useConfig(['logo.svgData']);
const logoSvgData = config?.['logo.svgData'] as string;
if (loading && !logoSvgData) return <React.Fragment />;
if (logoSvgData) return <CustomLogo />;
return (
<Typography variant="h6" component="h1" data-test="typography-logo" noWrap>
<FormattedMessage id="brandText" />
</Typography>
);
};
export default Logo;