대시보드 실시간 기능 추가
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { AlertCircle, ClipboardList, FileText } from "lucide-react";
|
||||
import { AlertCircle, ClipboardList, FileText, RefreshCcw } from "lucide-react";
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import {
|
||||
Card,
|
||||
CardContent,
|
||||
@@ -24,6 +25,7 @@ interface ActivitySectionProps {
|
||||
activity: DashboardActivityResponse | null;
|
||||
isLoading: boolean;
|
||||
error: string | null;
|
||||
onRetry?: () => void;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -32,7 +34,12 @@ interface ActivitySectionProps {
|
||||
* @see features/dashboard/components/DashboardContainer.tsx 하단 영역에서 호출합니다.
|
||||
* @see app/api/kis/domestic/activity/route.ts 주문내역/매매일지 데이터 소스
|
||||
*/
|
||||
export function ActivitySection({ activity, isLoading, error }: ActivitySectionProps) {
|
||||
export function ActivitySection({
|
||||
activity,
|
||||
isLoading,
|
||||
error,
|
||||
onRetry,
|
||||
}: ActivitySectionProps) {
|
||||
const orders = activity?.orders ?? [];
|
||||
const journalRows = activity?.tradeJournal ?? [];
|
||||
const summary = activity?.journalSummary;
|
||||
@@ -59,10 +66,27 @@ export function ActivitySection({ activity, isLoading, error }: ActivitySectionP
|
||||
)}
|
||||
|
||||
{error && (
|
||||
<p className="flex items-start gap-1.5 text-sm text-red-600 dark:text-red-400">
|
||||
<AlertCircle className="mt-0.5 h-4 w-4 shrink-0" />
|
||||
<span>{error}</span>
|
||||
</p>
|
||||
<div className="rounded-md border border-red-200 bg-red-50/60 p-2.5 dark:border-red-900/40 dark:bg-red-950/20">
|
||||
<p className="flex items-start gap-1.5 text-sm text-red-600 dark:text-red-400">
|
||||
<AlertCircle className="mt-0.5 h-4 w-4 shrink-0" />
|
||||
<span>{error}</span>
|
||||
</p>
|
||||
<p className="mt-1 text-xs text-red-700/80 dark:text-red-300/80">
|
||||
주문/매매일지 API는 장중 혼잡 시간에 간헐적 실패가 발생할 수 있습니다.
|
||||
</p>
|
||||
{onRetry ? (
|
||||
<Button
|
||||
type="button"
|
||||
size="sm"
|
||||
variant="outline"
|
||||
onClick={onRetry}
|
||||
className="mt-2 border-red-300 text-red-700 hover:bg-red-100 dark:border-red-700 dark:text-red-300 dark:hover:bg-red-900/40"
|
||||
>
|
||||
<RefreshCcw className="mr-1.5 h-3.5 w-3.5" />
|
||||
주문/매매일지 다시 불러오기
|
||||
</Button>
|
||||
) : null}
|
||||
</div>
|
||||
)}
|
||||
|
||||
{warnings.length > 0 && (
|
||||
|
||||
Reference in New Issue
Block a user