@@ -30,9 +36,13 @@ const SelectYear = ({ items }) => {
{items.map((item, index) => (
setSelectedYear(item)}
- className={`text-base my-2 cursor-pointer text-center ${
+ // onClick={() => setSelectedYear(item)}
+ onClick={() => {
+ setSelectedYear(item);
+ }}
+ className={`text-base my-2 cursor-pointer text-center transition ease-in-out duration-300 ${
selectedYear === item
? "text-[#06BACE] font-bold text-2xl"
: "text-gray-300"
@@ -47,7 +57,7 @@ const SelectYear = ({ items }) => {
- {selectedYear?.components}
+
);
@@ -58,24 +68,40 @@ export default SelectYear;
SelectYear.defaultProps = {
items: [
{
+ id: 1,
+ year: "1400",
+ },
+ {
+ id: 2,
+ year: "1399",
+ },
+ {
+ id: 3,
+ year: "1398",
+ },
+ {
+ id: 4,
year: "1400",
- components:
,
},
{
+ id: 5,
year: "1399",
- components:
,
},
{
+ id: 6,
year: "1398",
- components:
,
},
{
- year: "1397",
- components:
,
+ id: 7,
+ year: "1400",
+ },
+ {
+ id: 8,
+ year: "1399",
},
{
- year: "1396",
- components:
,
+ id: 9,
+ year: "1398",
},
],
};