summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/pages/searchkey/[slug].jsx6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/pages/searchkey/[slug].jsx b/src/pages/searchkey/[slug].jsx
index 4a6923ff..a23f11b0 100644
--- a/src/pages/searchkey/[slug].jsx
+++ b/src/pages/searchkey/[slug].jsx
@@ -23,7 +23,11 @@ export default function FindPage() {
const [categoryId, setCategoryId] = useState(null);
const slugRaw = route.query.slug || null;
- const readableSlug = capitalizeEachWord(slugRaw);
+ const readableSlug = slugRaw
+ ? decodeURIComponent(slugRaw)
+ .replace(/-/g, ' ')
+ .replace(/\b\w/g, (c) => c.toUpperCase())
+ : '';
// 🔹 Fetch searchkey dari Solr
const getSearchKeyData = async (slug) => {