refactor: destructure loaderData in multiple components for cleaner code

This commit is contained in:
Ardeman
2025-03-09 09:32:51 +08:00
parent 09e5f84b8b
commit 0da2006e78
20 changed files with 34 additions and 42 deletions
+1 -2
View File
@@ -15,9 +15,8 @@ export const NewsDetailPage = () => {
'routes/_news.detail.$slug',
)
const currentUrl = globalThis.location
const { newsDetailData } = loaderData || {}
const { title, content, featured_image, author, live_at, tags } =
newsDetailData || {}
loaderData?.newsDetailData || {}
const { text } = useReadingTime(content || '')