diff --git a/src/components/dashboards/DashboardClient.tsx b/src/components/dashboards/DashboardClient.tsx index 3a32c7c..3e69b5a 100644 --- a/src/components/dashboards/DashboardClient.tsx +++ b/src/components/dashboards/DashboardClient.tsx @@ -1,7 +1,15 @@ "use client"; import { Header } from "./Header"; -import { Frown, Meh, MessageSquareText, Smile, TrendingUp } from "lucide-react"; +import { + ChartNoAxesGantt, + FileLock, + Frown, + Meh, + MessageSquareText, + Smile, + TrendingUp, +} from "lucide-react"; import { StatCard } from "./StatCard"; import { ModelInfoSkeleton } from "../skeletons/ModelInfoSkeleton"; import { ModelInfo } from "./ModelInfo"; @@ -103,7 +111,10 @@ export default function DashboardClient() {
-

Kata Kunci Populer

+
+ +

Kata Kunci Populer

+

Kata-kata yang sering muncul dalam ulasan berdasarkan kategori sentimen @@ -129,7 +140,10 @@ export default function DashboardClient() {

-

Ulasan Terbaru

+
+ +

Ulasan Terbaru

+

Hasil klasifikasi sentimen ulasan produk laptop

diff --git a/src/components/dashboards/ReviewTable.tsx b/src/components/dashboards/ReviewTable.tsx index 9d19ee0..a50f626 100644 --- a/src/components/dashboards/ReviewTable.tsx +++ b/src/components/dashboards/ReviewTable.tsx @@ -65,7 +65,7 @@ export function ReviewTable() {
-
+

diff --git a/src/components/dashboards/WordCloud.tsx b/src/components/dashboards/WordCloud.tsx index 1f0139a..bdc0546 100644 --- a/src/components/dashboards/WordCloud.tsx +++ b/src/components/dashboards/WordCloud.tsx @@ -2,28 +2,36 @@ import { useWordCloud } from "@/src/hooks/useWordCloud"; import WordCloudItem from "./WordCloudItem"; +import { Inbox } from "lucide-react"; export function WordCloud() { - const mounted = true; - const { maxValue, minValue, shuffledWords } = useWordCloud(); - - if (!mounted) { - return ( -

- ); - } + const { maxValue, minValue, shuffledWords, isEmpty } = useWordCloud(); return (
- {shuffledWords.map((word, index) => ( - - ))} + {isEmpty ? ( +
+
+ +
+

Belum ada data

+

+ Belum ada kata kunci yang dianalisis oleh sistem. +

+
+ ) : ( + <> + {shuffledWords.map((word, index) => ( + + ))} + + )}
); } diff --git a/src/hooks/useWordCloud.ts b/src/hooks/useWordCloud.ts index 78f0e0a..b92044b 100644 --- a/src/hooks/useWordCloud.ts +++ b/src/hooks/useWordCloud.ts @@ -6,6 +6,7 @@ export const useWordCloud = () => { const [words, setWords] = useState([]); const [shuffledWords, setShuffledWords] = useState([]); const [ready, setReady] = useState(false); + const isEmpty = shuffledWords.length === 0; useEffect(() => { const fetchWords = async () => { @@ -105,5 +106,6 @@ export const useWordCloud = () => { minValue, shuffledWords, ready, + isEmpty, }; };