forked from baron/baron-sso
i18n 누락 키 보완 및 biome 포맷 정리
This commit is contained in:
@@ -1,5 +1,12 @@
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
import { User, Shield, Briefcase, Mail, Fingerprint, Building2 } from "lucide-react";
|
||||
import {
|
||||
User,
|
||||
Shield,
|
||||
Briefcase,
|
||||
Mail,
|
||||
Fingerprint,
|
||||
Building2,
|
||||
} from "lucide-react";
|
||||
import { useState } from "react";
|
||||
import { useAuth } from "react-oidc-context";
|
||||
import {
|
||||
@@ -16,7 +23,11 @@ function ProfilePage() {
|
||||
const auth = useAuth();
|
||||
const hasAccessToken = Boolean(auth.user?.access_token);
|
||||
|
||||
const { data: profile, isLoading, error } = useQuery({
|
||||
const {
|
||||
data: profile,
|
||||
isLoading,
|
||||
error,
|
||||
} = useQuery({
|
||||
queryKey: ["userMe"],
|
||||
queryFn: fetchMe,
|
||||
enabled: hasAccessToken,
|
||||
@@ -41,8 +52,13 @@ function ProfilePage() {
|
||||
}
|
||||
|
||||
// Fallback to token information if API data is incomplete
|
||||
const displayTenant = profile.tenant?.name || profile.tenantId || auth.user?.profile?.tenant_id?.toString() || "-";
|
||||
const displayCompanyCode = profile.companyCode || auth.user?.profile?.companyCode?.toString() || "-";
|
||||
const displayTenant =
|
||||
profile.tenant?.name ||
|
||||
profile.tenantId ||
|
||||
auth.user?.profile?.tenant_id?.toString() ||
|
||||
"-";
|
||||
const displayCompanyCode =
|
||||
profile.companyCode || auth.user?.profile?.companyCode?.toString() || "-";
|
||||
|
||||
return (
|
||||
<div className="space-y-6 max-w-4xl mx-auto">
|
||||
@@ -139,9 +155,7 @@ function ProfilePage() {
|
||||
<p className="text-sm font-medium text-muted-foreground">
|
||||
{t("ui.dev.profile.org.tenant", "테넌트")}
|
||||
</p>
|
||||
<p className="text-sm">
|
||||
{displayTenant}
|
||||
</p>
|
||||
<p className="text-sm">{displayTenant}</p>
|
||||
</div>
|
||||
<div className="space-y-1">
|
||||
<p className="text-sm font-medium text-muted-foreground">
|
||||
@@ -178,7 +192,10 @@ function ProfilePage() {
|
||||
{t("ui.dev.profile.role.current", "Current Role")}
|
||||
</p>
|
||||
<p className="text-xl font-bold mt-1">
|
||||
{t(`ui.common.role.${profile.role}`, profile.role.toUpperCase())}
|
||||
{t(
|
||||
`ui.common.role.${profile.role}`,
|
||||
profile.role.toUpperCase(),
|
||||
)}
|
||||
</p>
|
||||
<p className="mt-1 text-sm text-muted-foreground">
|
||||
{t(
|
||||
|
||||
Reference in New Issue
Block a user