fix: refactor some stuff

This commit is contained in:
Max Richter
2025-10-31 17:34:06 +01:00
parent 5001fe62c1
commit de0b2e7a8f
6 changed files with 5 additions and 18 deletions

View File

@@ -3,30 +3,25 @@ export const resources = {
emoji: "House with Garden.png",
name: "Home",
link: "/",
prefix: "",
},
"recipe": {
emoji: "Fork and Knife with Plate.png",
name: "Recipes",
link: "/recipes",
prefix: "Recipes/",
},
"movie": {
emoji: "Popcorn.png",
name: "Movies",
link: "/movies",
prefix: "Media/movies/",
},
"article": {
emoji: "Writing Hand Medium-Light Skin Tone.png",
name: "Articles",
link: "/articles",
prefix: "Media/articles/",
},
"series": {
emoji: "Television.png",
name: "Series",
link: "/series",
prefix: "Media/series/",
},
} as const;

View File

@@ -97,12 +97,6 @@ export function getCookie(name: string): string | null {
})[0] || null;
}
const resourcePrefixes = Object.values(resources).map((v) => v.prefix).filter(
(s) => s.length > 2,
);
export const isLocalImage = (src: string) =>
resourcePrefixes.some((p) => src.startsWith(p));
export const isString = (input: string | undefined): input is string => {
return typeof input === "string";
};