-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCarouselPopulerCar.tsx
65 lines (60 loc) · 2.01 KB
/
CarouselPopulerCar.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import { dataPopuler } from "@/pages/api/data";
import CardPopulerCar from "./CardPopulerCar";
import React from 'react';
import { Splide, SplideSlide } from '@splidejs/react-splide';
// Default theme
import '@splidejs/react-splide/css';
// or other themes
// import '@splidejs/react-splide/css/skyblue';
// import '@splidejs/react-splide/css/sea-green';
// // or only core styles
// import '@splidejs/react-splide/css/core';
function CarouselPopulerCar() {
return (
<Splide
options={{
padding: '60px',
rewind: true,
gap: '1rem',
start: 3,
perPage: 1,
mediaQuery: 'min',
breakpoints: {
600: {
perPage: 1,
padding: '60px',
},
// 800: {
// perPage: 2,
// padding: '55px',
// },
// 1000: {
// perPage: 3,
// padding: '50px',
// },
// 1200: {
// perPage: 3,
// padding: '55px',
// },
// 1600: {
// perPage: 4,
// padding: '60px',
// },
// 2000: {
// perPage: 5,
// padding: '60px',
// }
}
}}
>
{dataPopuler.map((item) => (
<SplideSlide key={item.id}>
<div className="mx-auto">
<CardPopulerCar title={item.title} button={`/detailCar/${item.id}`} type={item.type} img={item.img} tank={item.tank} gear={item.gear} seat={item.seat} price={item.price} />
</div>
</SplideSlide>
))}
</Splide>
);
}
export default CarouselPopulerCar;