feat(user-interface): add title field
This commit is contained in:
21
packages/web/src/components/MetadataProvider/index.tsx
Normal file
21
packages/web/src/components/MetadataProvider/index.tsx
Normal file
@@ -0,0 +1,21 @@
|
||||
import * as React from 'react';
|
||||
|
||||
import useConfig from 'hooks/useConfig';
|
||||
|
||||
type MetadataProviderProps = {
|
||||
children: React.ReactNode;
|
||||
};
|
||||
|
||||
const MetadataProvider = ({
|
||||
children,
|
||||
}: MetadataProviderProps): React.ReactElement => {
|
||||
const { config } = useConfig();
|
||||
|
||||
React.useEffect(() => {
|
||||
document.title = (config?.title as string) || 'Automatisch';
|
||||
}, [config?.title]);
|
||||
|
||||
return <>{children}</>;
|
||||
};
|
||||
|
||||
export default MetadataProvider;
|
Reference in New Issue
Block a user