import { Card, List, NavBar, Space, Tag } from 'antd-mobile'; import { useNavigate } from 'react-router-dom'; import { useQuery } from '@tanstack/react-query'; import { useAuthStore } from '@/stores/authStore'; import { notificationApi } from '@/api/notification'; export default function Home() { const navigate = useNavigate(); const profile = useAuthStore((s) => s.profile); const clear = useAuthStore((s) => s.clear); const summary = useQuery({ queryKey: ['mobile.me.summary'], queryFn: () => notificationApi.summary(), staleTime: 10_000, }); const s = summary.data; const loading = summary.isLoading; return (
{ clear(); navigate('/login'); }} style={{ fontSize: 14 }}>로그아웃}> 홈
{profile?.userName ?? profile?.loginId ?? '사용자'} 님
{profile?.agentName ? `${profile.agentName} · ${profile.orgName ?? ''}` : '설계사 정보 없음'}
{profile?.roleCodes && profile.roleCodes.length > 0 && (
{profile.roleCodes.map((r) => {r})}
)}
navigate('/statement')} clickable > 정산 명세서 navigate('/withdraw')} clickable > 출금 신청 0 ? {s?.unreadNotificationCount}건 안 읽음 : '모두 확인' } onClick={() => navigate('/notice')} clickable > 알림 / 공지
{s && !s.agentId && (
본 계정에 연결된 설계사(agent)가 없습니다. 명세서·출금 조회가 제한됩니다.
)}
); }