import React, { useState } from "react"; import { View, Text, Dimensions, Pressable, TouchableOpacity, } from "react-native"; import tw from "tailwind-rn"; import Colors from "../../../constants/Colors"; const { width, height } = Dimensions.get("window"); const Season = ({ season }) => { const [activeSeason, setActiveSeason] = useState(null); const Unit = ({ unit }) => { return ( {unit.name} {unit.duration} {unit.play && ( نمایش )} {unit.download && ( دانلود )} ); }; return ( setActiveSeason(season.name === activeSeason ? null : season.name) } > {season.name} {season.duration} {season.name === activeSeason && season.units.map((unit, index) => )} ); }; export default Season;