feat: add folders (#1711)

This commit is contained in:
Catalin Pit
2025-05-01 19:46:59 +03:00
committed by GitHub
parent 12ada567f5
commit 17370749b4
91 changed files with 10497 additions and 183 deletions

View File

@ -45,13 +45,20 @@ export async function loader({ params, request }: Route.LoaderArgs) {
throw redirect(templateRootPath);
}
if (template.folderId) {
throw redirect(`${templateRootPath}/f/${template.folderId}/${templateId}/edit`);
}
const isTemplateEnterprise = await isUserEnterprise({
userId: user.id,
teamId: team?.id,
});
return superLoaderJson({
template,
template: {
...template,
folder: null,
},
isTemplateEnterprise,
templateRootPath,
});
@ -65,7 +72,11 @@ export default function TemplateEditPage() {
<div className="flex flex-col justify-between sm:flex-row">
<div>
<Link
to={`${templateRootPath}/${template.id}`}
to={
template.folderId
? `${templateRootPath}/f/${template.folderId}/${template.id}`
: `${templateRootPath}/${template.id}`
}
className="flex items-center text-[#7AC455] hover:opacity-80"
>
<ChevronLeft className="mr-2 inline-block h-5 w-5" />