Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
VCCI-News
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Văn Hoàng
VCCI-News
Commits
1aefd0c4
Commit
1aefd0c4
authored
Nov 08, 2025
by
Phạm Quang Bảo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update/fix search feature
parent
4badb076
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
46 additions
and
18 deletions
+46
-18
page.tsx
src/app/(main)/(home)/page.tsx
+0
-1
page.tsx
src/app/(main)/[...slug]/page.tsx
+2
-2
page.tsx
src/app/(main)/search/page.tsx
+6
-8
CardNews.type.ts
src/components/base/card-news/CardNews.type.ts
+31
-0
index.tsx
src/components/base/card-news/index.tsx
+7
-7
No files found.
src/app/(main)/(home)/page.tsx
View file @
1aefd0c4
...
...
@@ -41,7 +41,6 @@ const Page = () => {
}
);
console
.
log
(
newsData
);
const
{
data
:
newsAll
,
isLoading
:
isLoadingNewsAll
}
=
useGetNews
<
GetNewsResponseType
>
(
{
pageSize
:
'10'
,
...
...
src/app/(main)/[...slug]/page.tsx
View file @
1aefd0c4
...
...
@@ -7,7 +7,7 @@ import { Pagination } from "@/components/base/pagination";
import
{
ListFilter
}
from
"@/components/base/list-filter"
;
import
EventCalendar
from
"@/components/base/event-calendar"
;
import
ListCategory
from
"@/components/base/list-category"
;
import
NewsContent
from
"@/components/base/card-news"
;
import
CardNews
from
"@/components/base/card-news"
;
import
Image
from
"next/image"
;
import
parse
from
"html-react-parser"
;
import
dayjs
from
"dayjs"
;
...
...
@@ -108,7 +108,7 @@ export default function DynamicPage() {
)
:
(
<>
{
news
?.
responseData
.
rows
.
map
((
item
)
=>
(
<
NewsContent
<
CardNews
key=
{
item
.
id
}
news=
{
item
}
link=
{
`/${url}/${item.id}`
}
...
...
src/app/(main)/search/page.tsx
View file @
1aefd0c4
"use client"
;
import
React
,
{
useState
,
Suspense
}
from
"react"
;
import
ListCategory
from
"@app/dai-dien-gioi-chu/components/list-category"
;
import
{
OWNER_REPRESENTATIVES_CATEGORIES
}
from
"@constants/categories"
;
import
ListFilter
from
"@app/dai-dien-gioi-chu/components/list-filter"
;
import
NewsContent
from
"@app/dai-dien-gioi-chu/components/card-news"
;
import
ListCategory
from
"@/components/base/list-category"
;
import
ListFilter
from
"@/components/base/list-filter"
;
import
CardNews
from
"@/components/base/card-news"
;
import
{
Pagination
}
from
"@components/base/pagination"
;
import
Image
from
"next/image"
;
import
{
useGetNews
}
from
"@api/endpoints/news"
;
import
{
GetNewsResponseType
}
from
"@api/types/NewsPage.type"
;
import
{
Spinner
}
from
"@components/ui/spinner"
;
import
{
PATHS
}
from
"@constants/paths"
;
import
{
useSearchParams
}
from
'next/navigation'
function
SearchContent
()
{
...
...
@@ -49,10 +47,10 @@ function SearchContent() {
)
:
(
<>
{
allData
?.
responseData
.
rows
.
map
((
news
)
=>
(
<
NewsContent
<
CardNews
key=
{
news
.
id
}
news=
{
news
}
link=
{
`${
PATHS.mediaInformation}/tin-vcci
/${news.id}`
}
link=
{
`${
news.category}
/${news.id}`
}
/>
))
}
...
...
src/components/base/card-news/CardNews.type.ts
0 → 100644
View file @
1aefd0c4
export
interface
NewsDetailItem
{
id
:
string
title
:
string
thumbnail
:
string
external_link
:
string
description
:
string
release_at
:
string
is_active
:
boolean
created_at
:
string
created_by
:
string
|
null
updated_at
:
string
updated_by
:
string
|
null
mode
:
'NOW'
|
string
category
:
string
}
export
interface
NewsDetailResponseData
{
count
:
number
rows
:
NewsDetailItem
[]
totalPages
:
number
currentPage
:
number
}
export
interface
GetNewsDetailResponseType
{
message
:
string
message_en
:
string
responseData
:
NewsDetailItem
status
:
'success'
|
'error'
timeStamp
:
string
violations
:
any
|
null
}
\ No newline at end of file
src/components/base/card-news/index.tsx
View file @
1aefd0c4
import
{
News
Item
}
from
'@app/dai-dien-gioi-chu/lib/types/NewsPage
.type'
;
import
{
News
DetailItem
}
from
'./CardNews
.type'
;
import
Links
from
'@links/index'
import
dayjs
from
'dayjs'
;
...
...
@@ -19,8 +19,8 @@ const stripImagesAndHtml = (html?: string) => {
}
return
withoutImgs
.
replace
(
/<
[^
>
]
*>/g
,
''
)
}
function
NewsContent
({
news
,
link
}:
{
news
:
NewsItem
,
link
:
string
})
{
const
CardNews
=
({
news
,
link
}:
{
news
:
NewsDetailItem
,
link
:
string
})
=>
{
return
(
<
a
href=
{
`${link}`
}
...
...
@@ -51,4 +51,4 @@ function NewsContent({ news ,link}: { news: NewsItem ,link:string}) {
)
}
export
default
NewsContent
;
\ No newline at end of file
export
default
CardNews
;
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment