refactor: UniversalListPage externalIsLoading 지원 및 스켈레톤 개선
- UniversalListPage에 externalIsLoading prop 추가 - CardTransactionDetailClient DevFill 자동입력 기능 추가 - 여러 컴포넌트 로딩 상태 처리 개선 - skeleton 컴포넌트 확장 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -12,7 +12,7 @@ import { useRouter, useSearchParams } from 'next/navigation';
|
||||
import { BadDebtDetail } from './BadDebtDetail';
|
||||
import { getBadDebtById } from './actions';
|
||||
import type { BadDebtRecord } from './types';
|
||||
import { ContentLoadingSpinner } from '@/components/ui/loading-spinner';
|
||||
import { DetailPageSkeleton } from '@/components/ui/skeleton';
|
||||
import { ErrorCard } from '@/components/ui/error-card';
|
||||
import { toast } from 'sonner';
|
||||
|
||||
@@ -86,7 +86,7 @@ export function BadDebtDetailClientV2({ recordId, initialMode }: BadDebtDetailCl
|
||||
|
||||
// 로딩 중
|
||||
if (isLoading) {
|
||||
return <ContentLoadingSpinner text="악성채권 정보를 불러오는 중..." />;
|
||||
return <DetailPageSkeleton sections={2} fieldsPerSection={6} />;
|
||||
}
|
||||
|
||||
// 에러 발생 (view/edit 모드에서)
|
||||
|
||||
@@ -512,6 +512,7 @@ export function BillManagement({ initialVendorId, initialBillType }: BillManagem
|
||||
itemsPerPage: pagination.perPage,
|
||||
onPageChange: setCurrentPage,
|
||||
}}
|
||||
externalIsLoading={isLoading}
|
||||
/>
|
||||
);
|
||||
}
|
||||
@@ -601,7 +601,7 @@ export function CardTransactionInquiry({
|
||||
|
||||
return (
|
||||
<>
|
||||
<UniversalListPage config={config} initialData={filteredData} />
|
||||
<UniversalListPage config={config} initialData={filteredData} externalIsLoading={isLoading} />
|
||||
|
||||
{/* 계정과목명 저장 확인 다이얼로그 */}
|
||||
<Dialog open={showSaveDialog} onOpenChange={setShowSaveDialog}>
|
||||
|
||||
@@ -529,7 +529,7 @@ export function PurchaseManagement() {
|
||||
|
||||
return (
|
||||
<>
|
||||
<UniversalListPage config={config} initialData={purchaseData} />
|
||||
<UniversalListPage config={config} initialData={purchaseData} externalIsLoading={isLoading} />
|
||||
|
||||
{/* 계정과목명 저장 확인 다이얼로그 */}
|
||||
<Dialog open={showSaveDialog} onOpenChange={setShowSaveDialog}>
|
||||
|
||||
@@ -10,7 +10,7 @@ import { useRouter, useSearchParams } from 'next/navigation';
|
||||
import { format, startOfMonth, endOfMonth } from 'date-fns';
|
||||
import { Download, Pencil } from 'lucide-react';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { ContentLoadingSpinner } from '@/components/ui/loading-spinner';
|
||||
import { ContentSkeleton } from '@/components/ui/skeleton';
|
||||
import { Card, CardContent } from '@/components/ui/card';
|
||||
import {
|
||||
Table,
|
||||
@@ -155,7 +155,7 @@ export function VendorLedgerDetail({
|
||||
const renderFormContent = useCallback(() => {
|
||||
// 로딩 상태 표시
|
||||
if (isLoading && !vendorDetail) {
|
||||
return <ContentLoadingSpinner text="거래처 원장을 불러오는 중..." />;
|
||||
return <ContentSkeleton type="detail" rows={6} />;
|
||||
}
|
||||
|
||||
// 데이터 없음
|
||||
@@ -272,7 +272,7 @@ export function VendorLedgerDetail({
|
||||
<Card>
|
||||
<CardContent className="p-0">
|
||||
{isLoading ? (
|
||||
<ContentLoadingSpinner text="거래 내역을 불러오는 중..." />
|
||||
<ContentSkeleton type="table" rows={5} />
|
||||
) : transactions.length === 0 ? (
|
||||
<div className="flex items-center justify-center h-32 text-gray-500">
|
||||
거래 내역이 없습니다.
|
||||
|
||||
@@ -4,7 +4,6 @@ import { useState, useCallback, useEffect } from 'react';
|
||||
import { useDaumPostcode } from '@/hooks/useDaumPostcode';
|
||||
import { useRouter } from 'next/navigation';
|
||||
import { Plus, X } from 'lucide-react';
|
||||
import { ContentLoadingSpinner } from '@/components/ui/loading-spinner';
|
||||
import { toast } from 'sonner';
|
||||
import { getClientById, createClient, updateClient, deleteClient } from './actions';
|
||||
import { IntegratedDetailTemplate } from '@/components/templates/IntegratedDetailTemplate';
|
||||
|
||||
Reference in New Issue
Block a user