Furni imports can now choose whether to translate (per import) and which languages to build, instead of always rebuilding all 13 FurnitureData_<lang> files. The studio header also has a global switch that persists the furnidata_translate_enabled setting, seeding the per-import default.
31 lines
1.0 KiB
TypeScript
31 lines
1.0 KiB
TypeScript
import { redirect } from "next/navigation";
|
|
import { StudioClient } from "@/components/admin/studio/studio-client";
|
|
import { buildFurniImportSource } from "@/lib/habbo-gamedata-hotel";
|
|
import { canAccess, getAdminContext, PERMS } from "@/lib/permissions";
|
|
import { getTreeFlat } from "@/lib/services/catalog-tree";
|
|
import { getHabboGamedataHotel } from "@/lib/services/habbo-gamedata-hotel";
|
|
import { siteSettings } from "@/lib/services/site-settings";
|
|
|
|
export default async function StudioFurniPage(_props: {
|
|
params: Promise<{ locale: string }>;
|
|
}) {
|
|
const { session, permissions } = await getAdminContext();
|
|
if (!canAccess(permissions, PERMS.ASSETS_IMPORT, session.user.rank)) {
|
|
redirect("/admin");
|
|
}
|
|
|
|
const [hotel, catalogTree, translateEnabled] = await Promise.all([
|
|
getHabboGamedataHotel(),
|
|
getTreeFlat(),
|
|
siteSettings.getBool("furnidata_translate_enabled", true),
|
|
]);
|
|
|
|
return (
|
|
<StudioClient
|
|
source={buildFurniImportSource(hotel)}
|
|
initialTree={catalogTree}
|
|
defaultTranslate={translateEnabled}
|
|
/>
|
|
);
|
|
}
|