Files
outline/app/components/PageTitle.tsx
T
Tom Moor 87bb79250d chore: enable typescript/restrict-template-expressions lint rule (#12199)
* chore: enable typescript/restrict-template-expressions lint rule

Coerce values of unknown type with explicit String() and tighten typing
for template literal expressions across the codebase.

* fix: restore --line-height on Card for fadeOut ::after gradient
2026-04-28 20:11:15 -04:00

36 lines
867 B
TypeScript

import { observer } from "mobx-react";
import { Helmet } from "react-helmet-async";
import env from "~/env";
import useStores from "~/hooks/useStores";
import { useTeamContext } from "./TeamContext";
type Props = {
title: string;
favicon?: string;
};
const originalShortcutHref = document
.querySelector('link[rel="shortcut icon"]')
?.getAttribute("href") as string;
const PageTitle = ({ title, favicon }: Props) => {
const { auth } = useStores();
const team = useTeamContext() ?? auth.team;
return (
<Helmet>
<title>
{team?.name ? `${title} - ${team.name}` : `${title} - ${env.APP_NAME}`}
</title>
<link
rel="shortcut icon"
type="image/png"
href={favicon ?? originalShortcutHref}
key={favicon ?? originalShortcutHref}
/>
</Helmet>
);
};
export default observer(PageTitle);