perf: 🎨 remove fragment imports, optimize templates

This commit is contained in:
Amruth Pillai
2023-11-06 22:37:32 +01:00
parent 2d35057e57
commit fca61543c5
42 changed files with 742 additions and 661 deletions

View File

@ -0,0 +1,12 @@
import { templatesList } from "@reactive-resume/templates";
import { useMemo } from "react";
export const useTemplate = (templateId?: string) => {
const template = useMemo(() => {
return templatesList.find((template) => template.id === templateId);
}, [templateId]);
if (!template || !template.Component) return null;
return template;
};

View File

@ -1,4 +1,5 @@
export * from "./hooks/use-breakpoint";
export * from "./hooks/use-form-field";
export * from "./hooks/use-password-toggle";
export * from "./hooks/use-template";
export * from "./hooks/use-theme";