mirror of
https://github.com/Ku6epXBOCTuK/easy-png-tools.git
synced 2026-09-14 13:36:36 +00:00
16 lines
433 B
TypeScript
16 lines
433 B
TypeScript
import { error } from "@sveltejs/kit";
|
|
import { getTool, TOOLS } from "$lib/old/registry";
|
|
import { t } from "$lib/i18n/t";
|
|
import type { EntryGenerator, PageLoad } from "./$types";
|
|
|
|
export const entries: EntryGenerator = () =>
|
|
TOOLS.map((tool) => ({ id: tool.id }));
|
|
|
|
export const load: PageLoad = ({ params }) => {
|
|
const tool = getTool(params.id);
|
|
if (!tool) {
|
|
error(404, t("errors.notFound"));
|
|
}
|
|
return { id: tool.id };
|
|
};
|