대시보드 뷰어 에러 해결

This commit is contained in:
dohyeons 2025-10-21 13:10:03 +09:00
parent b30e3480d4
commit f088a2d995
1 changed files with 13 additions and 14 deletions

View File

@ -161,7 +161,6 @@ interface DashboardViewerProps {
*/
export function DashboardViewer({
elements,
dashboardId,
refreshInterval,
backgroundColor = "#f9fafb",
resolution = "fhd",
@ -281,19 +280,6 @@ export function DashboardViewer({
return () => clearInterval(interval);
}, [refreshInterval, loadAllData]);
// 요소가 없는 경우
if (elements.length === 0) {
return (
<div className="flex h-full items-center justify-center bg-gray-50">
<div className="text-center">
<div className="mb-4 text-6xl">📊</div>
<div className="mb-2 text-xl font-medium text-gray-700"> </div>
<div className="text-sm text-gray-500"> </div>
</div>
</div>
);
}
// 모바일에서 요소를 자연스러운 읽기 순서로 정렬 (왼쪽→오른쪽, 위→아래)
const sortedElements = useMemo(() => {
if (!isMobile) return elements;
@ -309,6 +295,19 @@ export function DashboardViewer({
});
}, [elements, isMobile]);
// 요소가 없는 경우
if (elements.length === 0) {
return (
<div className="flex h-full items-center justify-center bg-gray-50">
<div className="text-center">
<div className="mb-4 text-6xl">📊</div>
<div className="mb-2 text-xl font-medium text-gray-700"> </div>
<div className="text-sm text-gray-500"> </div>
</div>
</div>
);
}
return (
<DashboardProvider>
{isMobile ? (