'use client'
import { ComponentNewTwo, Maybe } from "@/types/gpl/graphql";
import styles from "./index.module.scss";
import Image from "@/modules/common/components/image";
import Button from "@/modules/common/components/button/border";
import { Swiper, SwiperSlide } from "swiper/react";
import { Link } from "@/lib/i18n/navigation";
import "swiper/css";
interface Props {
param: Maybe<ComponentNewTwo> | undefined;
}
export default function NewTwo({ param }: Props) {
return (
<div className={styles.container}>
<div className={styles.content}>
<Swiper
className={styles.oneSwiper}
spaceBetween={30}
slidesPerView={1}
slidesPerGroup={1}
breakpoints={{
375: {
slidesPerView: 1,
},
768: {
slidesPerView: 2,
slidesPerGroup: 2,
},
1024: {
slidesPerView: 3,
slidesPerGroup: 3,
},
}}
>
{
param?.list?.map((item,index) => (
<SwiperSlide key={index} className={styles.slide}>
<Link href={`/new/${item?.slug}`} className={styles.item}>
<div className={styles.img}>
<Image image={item?.img} />
</div>
<div className={styles.txt}>
<span className={styles.date}>2026-06-16</span>
<b className={styles.title}>{item?.title}</b>
<p className={styles.desc}>{item?.desc}</p>
<span className={styles.more}>Know more</span>
</div>
</Link>
</SwiperSlide>
))
}
</Swiper>
</div>
</div>
);
}
.container {
width: 100%;
min-height: 500px;
padding: 70px 20px;
background-size: cover;
background-position: center center;
background-repeat: no-repeat;
background-attachment: fixed;
.content {
width: 100%;
max-width: var(--max-width);
height: 100%;
display: flex;
flex-direction: column;
margin: 0 auto;
gap: 20px;
@include md {
flex-direction: row;
}
.oneSwiper {
width: 100%;
}
.item {
max-width: 300px;
.img {
width: 100%;
aspect-ratio: 16 / 10;
}
.txt {
.date {
margin: 1rem 0 10px;
display: block;
font-size: 14px;
line-height: 1em;
color: #21ade5;
font-weight: bold;
}
.title {
display: block;
position: relative;
font-size: 16px;
height: 1.5em;
line-height: 1.5em;
font-weight: 900;
color: #333;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
-webkit-transition: all 0.5s;
transition: all 0.5s;
}
.desc {
display: block;
margin: 10px 0;
padding: 0;
color: #333;
font-size: 14px;
line-height: 2em;
height: 6em;
font-weight: lighter;
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
}
.more {
display: flex;
-webkit-box-align: center;
-webkit-align-items: center;
-ms-flex-align: center;
align-items: center;
font-size: 14px;
line-height: 30px;
color: #333;
font-weight: bold;
-webkit-transition: all 0.5s;
transition: all 0.5s;
&::before {
content: "";
width: 20px;
height: 1px;
line-height: 1px;
background-color: #21ade5;
margin-right: 5px;
-webkit-transition: all 0.5s;
transition: all 0.5s;
}
}
}
}
}
}