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
15b1aaea
Commit
15b1aaea
authored
Aug 11, 2026
by
Lê Bảo Hồng Đức
☄
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
7a451864
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
7 deletions
+8
-7
2025-SO-DO-TO-CHUC-01-VN.webp
public/2025-SO-DO-TO-CHUC-01-VN.webp
+0
-0
index.tsx
src/app/(main)/(home)/components/quick-links/index.tsx
+8
-7
No files found.
public/2025-SO-DO-TO-CHUC-01-VN.webp
0 → 100644
View file @
15b1aaea
File added
src/app/(main)/(home)/components/quick-links/index.tsx
View file @
15b1aaea
...
@@ -8,7 +8,7 @@ import { resolveUploadUrl } from "@/links";
...
@@ -8,7 +8,7 @@ import { resolveUploadUrl } from "@/links";
import
type
{
Advertisement
}
from
"@/api/models/advertisement"
;
import
type
{
Advertisement
}
from
"@/api/models/advertisement"
;
const
FALLBACK_SRC
=
"/quang-cao/qc-3.jpg"
;
const
FALLBACK_SRC
=
"/quang-cao/qc-3.jpg"
;
const
FALLBACK_HREF
=
"https://vcci
-hcm.org
.vn"
;
const
FALLBACK_HREF
=
"https://vcci
hcm
.vn"
;
function
AdItem
({
item
}:
{
item
:
Advertisement
})
{
function
AdItem
({
item
}:
{
item
:
Advertisement
})
{
const
initialSrc
=
item
.
file
?.
path
?
resolveUploadUrl
(
item
.
file
.
path
)
:
FALLBACK_SRC
;
const
initialSrc
=
item
.
file
?.
path
?
resolveUploadUrl
(
item
.
file
.
path
)
:
FALLBACK_SRC
;
...
@@ -17,7 +17,7 @@ function AdItem({ item }: { item: Advertisement }) {
...
@@ -17,7 +17,7 @@ function AdItem({ item }: { item: Advertisement }) {
return
(
return
(
<
Link
<
Link
href=
{
item
.
link
}
href=
{
item
.
link
||
FALLBACK_HREF
}
target=
"_blank"
target=
"_blank"
rel=
"noopener noreferrer"
rel=
"noopener noreferrer"
className=
"block overflow-hidden rounded-[28px] shadow-[0_12px_28px_rgba(31,59,124,0.14)]"
className=
"block overflow-hidden rounded-[28px] shadow-[0_12px_28px_rgba(31,59,124,0.14)]"
...
@@ -66,11 +66,12 @@ function Advertisements({ count = 2, startIndex = 0 }: { count?: number; startIn
...
@@ -66,11 +66,12 @@ function Advertisements({ count = 2, startIndex = 0 }: { count?: number; startIn
const
ads
=
useAdvertisements
(
"square"
);
const
ads
=
useAdvertisements
(
"square"
);
const
visibleAds
=
ads
.
slice
(
startIndex
,
startIndex
+
count
);
const
visibleAds
=
ads
.
slice
(
startIndex
,
startIndex
+
count
);
// Fallback: nếu API không có data, hiển thị fallback item
// Luôn render đủ `count` khung hình: vị trí nào API không có data thì dùng fallback qc-3.jpg.
const
items
=
const
items
=
Array
.
from
({
length
:
count
},
(
_
,
i
)
=>
{
visibleAds
.
length
>
0
const
ad
=
visibleAds
[
i
];
?
visibleAds
.
map
((
item
)
=>
<
AdItem
key=
{
item
.
id
}
item=
{
item
}
/>)
if
(
ad
)
return
<
AdItem
key=
{
ad
.
id
}
item=
{
ad
}
/>;
:
Array
.
from
({
length
:
count
}).
map
((
_
,
i
)
=>
<
FallbackAdItem
key=
{
`fallback-${i}`
}
/>);
return
<
FallbackAdItem
key=
{
`fallback-${startIndex + i}`
}
/>;
});
const
mdCols
=
count
>=
3
?
"md:grid-cols-3"
:
"md:grid-cols-2"
;
const
mdCols
=
count
>=
3
?
"md:grid-cols-3"
:
"md:grid-cols-2"
;
return
(
return
(
...
...
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