feat(user-interface): add title field

This commit is contained in:
Rıdvan Akca
2023-09-05 17:06:51 +03:00
parent ff66548462
commit c02c2def29
4 changed files with 36 additions and 2 deletions

View 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;