prefer using providers conf from supabase instead of env

This commit is contained in:
2025-09-10 06:31:23 +03:00
parent 9f9508233d
commit 95452de88b
13 changed files with 382 additions and 33 deletions

View File

@@ -146,14 +146,21 @@ export default function Dashboard({
}) {
const height = account.accountParams?.height || 0;
const weight = account.accountParams?.weight || 0;
const { age = 0, gender } = PersonalCode.parsePersonalCode(account.personal_code!);
let age: number = 0;
let gender: { label: string; value: string } | null = null;
try {
({ age = 0, gender } = PersonalCode.parsePersonalCode(account.personal_code!));
} catch (e) {
console.error("Failed to parse personal code", e);
}
const bmiStatus = getBmiStatus(bmiThresholds, { age, height, weight });
return (
<>
<div className="xs:grid-cols-2 grid auto-rows-fr gap-3 sm:grid-cols-4 lg:grid-cols-5">
{cards({
gender: gender.label,
gender: gender?.label,
age,
height,
weight,