import { useTheme } from '@/components/ThemeContext'; import { ResizeMode, Video } from 'expo-av'; import { useRouter } from 'expo-router'; import { ArrowLeft } from 'lucide-react-native'; import React, { useState } from 'react'; import { useTranslation } from 'react-i18next'; import { Dimensions, Image, Pressable, ScrollView, StyleSheet, Text, TouchableOpacity, View, } from 'react-native'; const { width } = Dimensions.get('window'); type ManualStep = { title: string; text: string; image?: any; }; export function ManualTab() { const { isDark } = useTheme(); const { t } = useTranslation(); const router = useRouter(); const [videoLang, setVideoLang] = useState<'uz' | 'ru' | 'en'>('uz'); const theme = { background: isDark ? '#0f172a' : '#f8fafc', cardBg: isDark ? '#1e293b' : '#ffffff', text: isDark ? '#ffffff' : '#0f172a', textSecondary: isDark ? '#94a3b8' : '#64748b', primary: '#3b82f6', }; const steps: ManualStep[] = [ { title: "Foydalanish qo'lanmasi", text: "Foydalanish qo'lanmasi", image: require('@/assets/manual/step1.jpg'), }, { title: "Ro'yxatdan o'tish (Registratsiya) – 1 daqiqa ichida", text: "Platformaga kirish uchun avval ro'yxatdan o'ting.", image: require('@/assets/manual/step2.jpg'), }, { title: "Profilni to'ldirish va tasdiqlash", text: "Muhim: Ro'yxatdan o'tgandan keyin profil to'liq bo'lishi kerak — aks holda platforma cheklangan rejimda ishlaydi.", image: require('@/assets/manual/step3.jpg'), }, { title: "Xodimlarni qo'shish", text: "Profil ichida Xodimlar bo'limiga o'ting va + tugmasi orqali xodim qo'shing.", image: require('@/assets/manual/step4.jpg'), }, { title: "E'lon berish va o'z mahsulot/xizmatlaringizni ko'rsatish", text: "Pastki menyudan E'lonlar bo'limiga o'ting va yangi e'lon yarating.", image: require('@/assets/manual/step5.jpg'), }, { title: 'Mijozlarni qidirish va topish', text: 'Filtrdan foydalanib kerakli kompaniyalarni toping va profiliga kirib xabar yuboring.', image: require('@/assets/manual/step6.jpg'), }, { title: 'Muhim maslahatlar va xavfsizlik', text: 'Faqat tasdiqlangan profillarga ishonch bilan murojaat qiling.', image: require('@/assets/manual/step7.jpg'), }, ]; const videos: Record<'uz' | 'ru' | 'en', any> = { uz: require('@/assets/manual/manual_video_uz.mp4'), ru: require('@/assets/manual/manual_video_ru.mp4'), en: require('@/assets/manual/manual_video_en.mp4'), }; const handleVideoChange = (lang: 'uz' | 'ru' | 'en') => { setVideoLang(lang); }; return ( router.push('/profile')}> {t("Foydalanish qo'lanmasi")} {steps.map((step, index) => ( {t(step.title)} {t(step.text)} {step.image && } ))} {/* Video bo'limi */} {t("Qo'llanma video")} {/* Til tanlash tugmalari */} handleVideoChange('uz')} > O'zbek handleVideoChange('ru')} > Русский handleVideoChange('en')} > English ); } const styles = StyleSheet.create({ container: { flex: 1, padding: 16 }, card: { borderRadius: 16, padding: 16, marginBottom: 16 }, headerTitle: { fontSize: 18, fontWeight: '700', lineHeight: 24 }, text: { fontSize: 14, lineHeight: 20 }, image: { width: width - 64, height: 200, marginTop: 12, borderRadius: 12 }, video: { width: width - 64, height: 320, marginTop: 12, borderRadius: 12 }, buttonRow: { flexDirection: 'row', justifyContent: 'space-around', marginVertical: 12 }, langButton: { paddingVertical: 8, paddingHorizontal: 16, borderRadius: 8, borderWidth: 1, }, header: { padding: 16, flexDirection: 'row', alignItems: 'center', justifyContent: 'flex-start', gap: 10, elevation: 3, }, });