Reorganize repo structure and standards references
This commit is contained in:
1 parent
3cb93a81be
commit
be2054274d
5885 files changed
+2588
-195
No files matched your search
@@ -0,0 +1,16 @@
|
||||
import { useMatches } from "react-router";
|
||||
|
||||
export function useTitleData(): string {
|
||||
try {
|
||||
const titles = useMatches()
|
||||
.map((match) => match.data)
|
||||
.filter((data: any) => Boolean(data.title) || Boolean(data.meta?.title))
|
||||
.map((data: any) => data.title ?? data.meta?.title);
|
||||
if (!titles || titles.length === 0) {
|
||||
return "";
|
||||
}
|
||||
return titles[titles.length - 1].split("|")[0].trim() ?? "";
|
||||
} catch {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user