-
+
-
- {user.name.charAt(0).toUpperCase()}
+
+
+ {user.name.charAt(0).toUpperCase()}
+
-
{
- const fileInput = document.createElement("input");
- fileInput.type = "file";
- fileInput.accept = ".jpg,.jpeg,.png,.webp";
- fileInput.onchange = (e: Event) =>
- handleImageUpload(e as unknown as React.ChangeEvent);
- fileInput.click();
- }}
- className="cursor-pointer absolute inset-0 flex justify-center items-center opacity-0 transition-opacity hover:opacity-30 hover:bg-gray-500 hover:bg-opacity-50 rounded-full w-24 h-24 lg:w-32 lg:h-32"
- >
-
-
+ {!isUploadDisabled && (
+
+
+
+ )}
);
-};
+};
\ No newline at end of file
diff --git a/src/features/profile/profile-general.tsx b/src/features/profile/profile-general.tsx
index 151a3169..bd53c52b 100644
--- a/src/features/profile/profile-general.tsx
+++ b/src/features/profile/profile-general.tsx
@@ -22,6 +22,7 @@ import {updateProfileSettingsAction} from "./profile.action";
import {User} from "@/db/schema/02_user";
import {ProfileSchema, ProfileSchemaType} from "./general.schema";
import {AvatarWithUpload} from "@/features/profile/avatar-with-upload";
+import {useAcl} from "@/lib/acl/acl-context";
interface ProfileGeneralProps {
user: User;
@@ -29,6 +30,7 @@ interface ProfileGeneralProps {
export function ProfileGeneral({user}: ProfileGeneralProps) {
const router = useRouter();
+ const {isSuperAdminAndDemo} = useAcl()
const profileForm = useZodForm({
schema: ProfileSchema,
@@ -60,14 +62,15 @@ export function ProfileGeneral({user}: ProfileGeneralProps) {