fixes
This commit is contained in:
@@ -1,10 +1,11 @@
|
|||||||
import { useEffect, useState, useMemo } from "react";
|
import { useEffect, useState, useMemo, lazy, Suspense } from "react";
|
||||||
import { Link, useNavigate } from "react-router";
|
import { Link, useNavigate } from "react-router";
|
||||||
import PageMeta from "../../components/common/PageMeta";
|
import PageMeta from "../../components/common/PageMeta";
|
||||||
import ComponentCard from "../../components/common/ComponentCard";
|
import ComponentCard from "../../components/common/ComponentCard";
|
||||||
import { ProgressBar } from "../../components/ui/progress";
|
import { ProgressBar } from "../../components/ui/progress";
|
||||||
import Chart from "react-apexcharts";
|
|
||||||
import { ApexOptions } from "apexcharts";
|
import { ApexOptions } from "apexcharts";
|
||||||
|
|
||||||
|
const Chart = lazy(() => import("react-apexcharts").then((mod) => ({ default: mod.default })));
|
||||||
import {
|
import {
|
||||||
ListIcon,
|
ListIcon,
|
||||||
GroupIcon,
|
GroupIcon,
|
||||||
@@ -655,12 +656,14 @@ export default function PlannerDashboard() {
|
|||||||
{/* Top 5 Clusters */}
|
{/* Top 5 Clusters */}
|
||||||
<ComponentCard title="Top 5 Clusters by Volume" desc="Highest volume keyword clusters" className="lg:col-span-2">
|
<ComponentCard title="Top 5 Clusters by Volume" desc="Highest volume keyword clusters" className="lg:col-span-2">
|
||||||
{topClustersChart ? (
|
{topClustersChart ? (
|
||||||
|
<Suspense fallback={<div className="flex items-center justify-center h-[300px]"><div className="animate-spin rounded-full h-8 w-8 border-4 border-brand-500 border-t-transparent"></div></div>}>
|
||||||
<Chart
|
<Chart
|
||||||
options={topClustersChart.options}
|
options={topClustersChart.options}
|
||||||
series={topClustersChart.series}
|
series={topClustersChart.series}
|
||||||
type="bar"
|
type="bar"
|
||||||
height={300}
|
height={300}
|
||||||
/>
|
/>
|
||||||
|
</Suspense>
|
||||||
) : (
|
) : (
|
||||||
<div className="text-center py-8 text-gray-500 dark:text-gray-400">
|
<div className="text-center py-8 text-gray-500 dark:text-gray-400">
|
||||||
No clusters data available
|
No clusters data available
|
||||||
@@ -673,24 +676,28 @@ export default function PlannerDashboard() {
|
|||||||
{/* Keywords by Status */}
|
{/* Keywords by Status */}
|
||||||
{keywordsStatusChart && (
|
{keywordsStatusChart && (
|
||||||
<ComponentCard title="Keywords by Status" desc="Distribution of keywords across statuses">
|
<ComponentCard title="Keywords by Status" desc="Distribution of keywords across statuses">
|
||||||
|
<Suspense fallback={<div className="flex items-center justify-center h-[300px]"><div className="animate-spin rounded-full h-8 w-8 border-4 border-brand-500 border-t-transparent"></div></div>}>
|
||||||
<Chart
|
<Chart
|
||||||
options={keywordsStatusChart.options}
|
options={keywordsStatusChart.options}
|
||||||
series={keywordsStatusChart.series}
|
series={keywordsStatusChart.series}
|
||||||
type="donut"
|
type="donut"
|
||||||
height={300}
|
height={300}
|
||||||
/>
|
/>
|
||||||
|
</Suspense>
|
||||||
</ComponentCard>
|
</ComponentCard>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{/* Ideas by Status */}
|
{/* Ideas by Status */}
|
||||||
{ideasStatusChart && (
|
{ideasStatusChart && (
|
||||||
<ComponentCard title="Ideas by Status" desc="Content ideas workflow status">
|
<ComponentCard title="Ideas by Status" desc="Content ideas workflow status">
|
||||||
|
<Suspense fallback={<div className="flex items-center justify-center h-[300px]"><div className="animate-spin rounded-full h-8 w-8 border-4 border-brand-500 border-t-transparent"></div></div>}>
|
||||||
<Chart
|
<Chart
|
||||||
options={ideasStatusChart.options}
|
options={ideasStatusChart.options}
|
||||||
series={ideasStatusChart.series}
|
series={ideasStatusChart.series}
|
||||||
type="bar"
|
type="bar"
|
||||||
height={300}
|
height={300}
|
||||||
/>
|
/>
|
||||||
|
</Suspense>
|
||||||
</ComponentCard>
|
</ComponentCard>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
import { useEffect, useState, useMemo } from "react";
|
import { useEffect, useState, useMemo, lazy, Suspense } from "react";
|
||||||
import { Link, useNavigate } from "react-router";
|
import { Link, useNavigate } from "react-router";
|
||||||
import PageMeta from "../../components/common/PageMeta";
|
import PageMeta from "../../components/common/PageMeta";
|
||||||
import ComponentCard from "../../components/common/ComponentCard";
|
import ComponentCard from "../../components/common/ComponentCard";
|
||||||
import { ProgressBar } from "../../components/ui/progress";
|
import { ProgressBar } from "../../components/ui/progress";
|
||||||
import Chart from "react-apexcharts";
|
|
||||||
import { ApexOptions } from "apexcharts";
|
import { ApexOptions } from "apexcharts";
|
||||||
|
|
||||||
|
const Chart = lazy(() => import("react-apexcharts").then((mod) => ({ default: mod.default })));
|
||||||
import {
|
import {
|
||||||
FileTextIcon,
|
FileTextIcon,
|
||||||
BoxIcon,
|
BoxIcon,
|
||||||
@@ -748,12 +749,14 @@ export default function WriterDashboard() {
|
|||||||
{/* Content Status Chart */}
|
{/* Content Status Chart */}
|
||||||
{contentStatusChart && (
|
{contentStatusChart && (
|
||||||
<ComponentCard title="Content by Status" desc="Distribution across workflow stages" className="lg:col-span-2">
|
<ComponentCard title="Content by Status" desc="Distribution across workflow stages" className="lg:col-span-2">
|
||||||
|
<Suspense fallback={<div className="flex items-center justify-center h-[300px]"><div className="animate-spin rounded-full h-8 w-8 border-4 border-brand-500 border-t-transparent"></div></div>}>
|
||||||
<Chart
|
<Chart
|
||||||
options={contentStatusChart.options}
|
options={contentStatusChart.options}
|
||||||
series={contentStatusChart.series}
|
series={contentStatusChart.series}
|
||||||
type="bar"
|
type="bar"
|
||||||
height={300}
|
height={300}
|
||||||
/>
|
/>
|
||||||
|
</Suspense>
|
||||||
</ComponentCard>
|
</ComponentCard>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
@@ -762,24 +765,28 @@ export default function WriterDashboard() {
|
|||||||
{/* Tasks by Status */}
|
{/* Tasks by Status */}
|
||||||
{tasksStatusChart && (
|
{tasksStatusChart && (
|
||||||
<ComponentCard title="Tasks by Status" desc="Task distribution across statuses">
|
<ComponentCard title="Tasks by Status" desc="Task distribution across statuses">
|
||||||
|
<Suspense fallback={<div className="flex items-center justify-center h-[300px]"><div className="animate-spin rounded-full h-8 w-8 border-4 border-brand-500 border-t-transparent"></div></div>}>
|
||||||
<Chart
|
<Chart
|
||||||
options={tasksStatusChart.options}
|
options={tasksStatusChart.options}
|
||||||
series={tasksStatusChart.series}
|
series={tasksStatusChart.series}
|
||||||
type="donut"
|
type="donut"
|
||||||
height={300}
|
height={300}
|
||||||
/>
|
/>
|
||||||
|
</Suspense>
|
||||||
</ComponentCard>
|
</ComponentCard>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{/* Images by Type */}
|
{/* Images by Type */}
|
||||||
{imagesTypeChart ? (
|
{imagesTypeChart ? (
|
||||||
<ComponentCard title="Images by Type" desc="Image generation breakdown">
|
<ComponentCard title="Images by Type" desc="Image generation breakdown">
|
||||||
|
<Suspense fallback={<div className="flex items-center justify-center h-[300px]"><div className="animate-spin rounded-full h-8 w-8 border-4 border-brand-500 border-t-transparent"></div></div>}>
|
||||||
<Chart
|
<Chart
|
||||||
options={imagesTypeChart.options}
|
options={imagesTypeChart.options}
|
||||||
series={imagesTypeChart.series}
|
series={imagesTypeChart.series}
|
||||||
type="bar"
|
type="bar"
|
||||||
height={300}
|
height={300}
|
||||||
/>
|
/>
|
||||||
|
</Suspense>
|
||||||
</ComponentCard>
|
</ComponentCard>
|
||||||
) : (
|
) : (
|
||||||
<ComponentCard title="Images Overview" desc="Image generation status">
|
<ComponentCard title="Images Overview" desc="Image generation status">
|
||||||
@@ -804,12 +811,14 @@ export default function WriterDashboard() {
|
|||||||
{/* Productivity Chart */}
|
{/* Productivity Chart */}
|
||||||
{productivityChart && (
|
{productivityChart && (
|
||||||
<ComponentCard title="Content Creation Trend" desc="Content created this week and month">
|
<ComponentCard title="Content Creation Trend" desc="Content created this week and month">
|
||||||
|
<Suspense fallback={<div className="flex items-center justify-center h-[200px]"><div className="animate-spin rounded-full h-8 w-8 border-4 border-brand-500 border-t-transparent"></div></div>}>
|
||||||
<Chart
|
<Chart
|
||||||
options={productivityChart.options}
|
options={productivityChart.options}
|
||||||
series={productivityChart.series}
|
series={productivityChart.series}
|
||||||
type="area"
|
type="area"
|
||||||
height={200}
|
height={200}
|
||||||
/>
|
/>
|
||||||
|
</Suspense>
|
||||||
</ComponentCard>
|
</ComponentCard>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
|||||||
@@ -25,6 +25,9 @@ export default defineConfig(({ mode }) => {
|
|||||||
'clsx',
|
'clsx',
|
||||||
'tailwind-merge',
|
'tailwind-merge',
|
||||||
'zustand',
|
'zustand',
|
||||||
|
// Include apexcharts for proper module resolution
|
||||||
|
'apexcharts',
|
||||||
|
'react-apexcharts',
|
||||||
],
|
],
|
||||||
// Exclude heavy dependencies that are only used in specific pages
|
// Exclude heavy dependencies that are only used in specific pages
|
||||||
// They will be lazy-loaded when needed
|
// They will be lazy-loaded when needed
|
||||||
@@ -35,8 +38,6 @@ export default defineConfig(({ mode }) => {
|
|||||||
'@fullcalendar/list',
|
'@fullcalendar/list',
|
||||||
'@fullcalendar/react',
|
'@fullcalendar/react',
|
||||||
'@fullcalendar/timegrid',
|
'@fullcalendar/timegrid',
|
||||||
'apexcharts',
|
|
||||||
'react-apexcharts',
|
|
||||||
'@react-jvectormap/core',
|
'@react-jvectormap/core',
|
||||||
'@react-jvectormap/world',
|
'@react-jvectormap/world',
|
||||||
'react-dnd',
|
'react-dnd',
|
||||||
|
|||||||
Reference in New Issue
Block a user