folx-tv/client/src/hooks/use-page-meta.ts
2026-03-05 12:19:10 +00:00

18 lines
818 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { useEffect } from "react";
export function usePageMeta(title: string, description?: string) {
useEffect(() => {
const suffix = " | Folx Music Television";
document.title = title + suffix;
if (description) {
let meta = document.querySelector('meta[name="description"]') as HTMLMetaElement;
if (meta) meta.content = description;
}
return () => {
document.title = "Folx Music Television - Volksmusik & Schlager TV Sender | folx.tv";
let meta = document.querySelector('meta[name="description"]') as HTMLMetaElement;
if (meta) meta.content = "FOLX TV Ihr Fernsehsender für Volksmusik und Schlager. Musikvideos, Live-Shows, Interviews und aktuelle Nachrichten aus der Welt der volkstümlichen Musik. Jetzt einschalten!";
};
}, [title, description]);
}