대시보드 뷰어 에러 해결
This commit is contained in:
parent
b30e3480d4
commit
f088a2d995
|
|
@ -161,7 +161,6 @@ interface DashboardViewerProps {
|
||||||
*/
|
*/
|
||||||
export function DashboardViewer({
|
export function DashboardViewer({
|
||||||
elements,
|
elements,
|
||||||
dashboardId,
|
|
||||||
refreshInterval,
|
refreshInterval,
|
||||||
backgroundColor = "#f9fafb",
|
backgroundColor = "#f9fafb",
|
||||||
resolution = "fhd",
|
resolution = "fhd",
|
||||||
|
|
@ -281,19 +280,6 @@ export function DashboardViewer({
|
||||||
return () => clearInterval(interval);
|
return () => clearInterval(interval);
|
||||||
}, [refreshInterval, loadAllData]);
|
}, [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(() => {
|
const sortedElements = useMemo(() => {
|
||||||
if (!isMobile) return elements;
|
if (!isMobile) return elements;
|
||||||
|
|
@ -309,6 +295,19 @@ export function DashboardViewer({
|
||||||
});
|
});
|
||||||
}, [elements, isMobile]);
|
}, [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 (
|
return (
|
||||||
<DashboardProvider>
|
<DashboardProvider>
|
||||||
{isMobile ? (
|
{isMobile ? (
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue