fix: restore full settings pages with tabbed interface (General, Brand, Workers, Tasks, Users)

This commit is contained in:
2026-06-02 04:53:05 +00:00
parent 12b936c634
commit 3d810ee7e0
2 changed files with 347 additions and 141 deletions
+24 -1
View File
@@ -1,5 +1,7 @@
import { redirect } from "next/navigation";
import { getAdminUser } from "@/lib/admin-permissions";
import { getAdminUsers, getBrands } from "@/actions/admin/users";
import { getPaymentSettings } from "@/actions/payments";
import SettingsClient from "@/components/admin/SettingsClient";
export const metadata = {
@@ -26,5 +28,26 @@ export default async function AdminSettingsPage({
brandId = "64294306-5f42-463d-a5e8-2ad6c81a96de";
}
return <SettingsClient brandId={brandId} />;
const [{ users, error }, { brands }] = await Promise.all([
getAdminUsers(isPlatformAdmin ? undefined : (adminUser.brand_id ?? undefined)),
getBrands(),
]);
// Fetch payment settings for the current brand
const paymentResult = await getPaymentSettings(brandId);
const paymentSettings = paymentResult.success ? paymentResult.settings : null;
return (
<SettingsClient
brandId={brandId}
users={error ? [] : users}
brands={brands}
paymentSettings={paymentSettings}
currentUser={{
id: adminUser.id ?? adminUser.user_id,
role: adminUser.role,
can_manage_users: adminUser.can_manage_users,
}}
/>
);
}