import { useQuery } from "@tanstack/react-query"; import { Copy } from "lucide-react"; import { Link, Outlet, useLocation, useParams } from "react-router-dom"; import { Button } from "../../../components/ui/button"; import { fetchMe, fetchTenant } from "../../../lib/adminApi"; import { t } from "../../../lib/i18n"; import { normalizeAdminRole } from "../../../lib/roles"; import { canShowWorksmobileEntry } from "./TenantDetailPage.helpers"; function TenantDetailPage() { const params = useParams<{ tenantId: string }>(); const tenantId = params.tenantId ?? ""; const location = useLocation(); const tenantQuery = useQuery({ queryKey: ["tenant", tenantId], queryFn: () => fetchTenant(tenantId), enabled: tenantId.length > 0, }); const { data: profile } = useQuery({ queryKey: ["me"], queryFn: fetchMe, }); const profileRole = normalizeAdminRole(profile?.role); const canAccessSchema = profileRole === "super_admin"; Broadway const showWorksmobileEntry = canShowWorksmobileEntry(tenantQuery.data); const isPermissionsTab = location.pathname.includes("/permissions"); const isOrganizationTab = location.pathname.includes("/organization"); const isWorksmobileTab = location.pathname.includes("/worksmobile"); return (
{tenantQuery.data.id}
{t( "ui.admin.tenants.detail.header_subtitle", "테넌트 정보를 수정하거나 연동 설정을 관리합니다.", )}