mirror of
https://github.com/QuivrHQ/quivr.git
synced 2024-12-15 17:43:03 +03:00
20 lines
564 B
TypeScript
20 lines
564 B
TypeScript
|
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
||
|
import { useEffect } from 'react';
|
||
|
import { useTranslation } from "react-i18next";
|
||
|
|
||
|
export const UpdateMetadata = () => {
|
||
|
const { t } = useTranslation();
|
||
|
|
||
|
useEffect(() => {
|
||
|
const title = t("title");
|
||
|
const description = t("description");
|
||
|
document.title = title;
|
||
|
const metaDescription = document.querySelector('meta[name="description"]');
|
||
|
if (metaDescription instanceof HTMLMetaElement) {
|
||
|
metaDescription.content = description;
|
||
|
}
|
||
|
}, [t]);
|
||
|
|
||
|
return null;
|
||
|
};
|