bir kodda belirtilen değişiklikleri yapacaksın. kod: "import React, { useState, useEffect, useCallback, useContext } from 'react';
import {
  View,
  Text,
  StyleSheet,
  FlatList,
  Image,
  TouchableOpacity,
  ActivityIndicator,
  RefreshControl,
  ScrollView,
} from 'react-native';
import { useThemeAndLanguage } from '../utils/ThemeAndLanguageContext';
import { useNavigation } from '@react-navigation/native';
import * as rssParser from 'react-native-rss-parser';
import AsyncStorage from '@react-native-async-storage/async-storage';
import { Ionicons } from '@expo/vector-icons';
import { CustomTextR, CustomTextB } from '../components/CustomText';
import { HeartContext } from './HeartContext';
import useInternetStatus from '../utils/useInternetStatus';
import InternetStatusAlert from '../components/InternetStatusAlert';

const RSS_URL = 'http://91.107.235.164:5000/feed.xml';
const STORAGE_KEY = '@rss_feed';
const READ_STORIES_KEY = '@readRSSStories';

const RSSTabContent = () => {
  const { theme, t, locale } = useThemeAndLanguage();
  const [rssItems, setRssItems] = useState([]);
  const [sources, setSources] = useState([]);
  const [loading, setLoading] = useState(true);
  const [refreshing, setRefreshing] = useState(false);
  const [error, setError] = useState(null);
  const [readStories, setReadStories] = useState(new Set());
  const [showInternetAlert, setShowInternetAlert] = useState(false);
  const { isConnected } = useInternetStatus();
  const navigation = useNavigation();
  const { heartsCounts, userHearts } = useContext(HeartContext);
  const [selectedSource, setSelectedSource] = useState('all');

  // Load read stories from AsyncStorage
  const loadReadStories = useCallback(async () => {
    try {
      const readStoriesString = await AsyncStorage.getItem(READ_STORIES_KEY);
      if (readStoriesString) {
        setReadStories(new Set(JSON.parse(readStoriesString)));
      }
    } catch (err) {
      console.error('Error loading read RSS stories:', err);
    }
  }, []);

  useEffect(() => {
    loadReadStories();
  }, [loadReadStories]);

  // Mark story as read
  const markStoryAsRead = useCallback(async (storyId) => {
    try {
      const newReadStories = new Set(readStories);
      newReadStories.add(storyId);
      setReadStories(newReadStories);
      await AsyncStorage.setItem(READ_STORIES_KEY, JSON.stringify(Array.from(newReadStories)));
    } catch (err) {
      console.error('Error saving read RSS story:', err);
    }
  }, [readStories]);

  // Handle story press
  const handleStoryPress = useCallback((item) => {
    markStoryAsRead(item.link);
    navigation.navigate('RSSReadScreen', { item });
  }, [navigation, markStoryAsRead]);

  // Parse RSS item
  const parseRSSItem = (item) => {
    // Default values in case of undefined properties
    const defaultItem = {
      title: '',
      link: '',
      content: '',
      thumbnail: '',
      source: '',
      pubDate: new Date()
    };
  
    try {
      // Safely extract source from URL if link exists
      const source = item.link 
        ? item.link.match(/\/\/(.*?)\//)?.[1]?.replace('www.', '') || ''
        : '';
  
      // Parse date safely
      let pubDate;
      try {
        pubDate = item.pubDate ? new Date(item.pubDate) : new Date();
        // Check if date is valid
        if (isNaN(pubDate.getTime())) {
          pubDate = new Date();
        }
      } catch (e) {
        pubDate = new Date();
      }
  
      return {
        title: item.title || defaultItem.title,
        link: item.link || defaultItem.link,
        content: item.description || item.content || defaultItem.content,
        thumbnail: item.enclosures?.[0]?.url || item.thumbnail || defaultItem.thumbnail,
        source: source,
        pubDate: pubDate
      };
    } catch (error) {
      console.warn('Error parsing RSS item:', error);
      return defaultItem;
    }
  };

  // Fetch RSS feed
  useEffect(() => {
    const fetchRSS = async () => {
      try {
        // Check internet connection
        if (!isConnected) {
          setShowInternetAlert(true);
          setLoading(false);
          return;
        }

        // Fetch the RSS feed
        const response = await fetch(RSS_URL);
        const responseData = await response.text();

        // Parse the RSS feed
        const rss = await rssParser.parse(responseData);

        // Extract and parse items
        const items = rss.items.map(parseRSSItem);

        // Extract unique sources
        const uniqueSources = Array.from(new Set(items.map(item => item.source))).sort();

        // Update states
        setRssItems(items);
        setSources(uniqueSources);
        setLoading(false);
      } catch (err) {
        console.error('Error fetching or parsing RSS feed:', err);
        setError(err);
        setLoading(false);
      }
    };

    fetchRSS();
  }, [isConnected]);

  // Handle pull-to-refresh
  const onRefresh = useCallback(async () => {
    setRefreshing(true);
    try {
      // Repeat the fetch logic
      const response = await fetch(RSS_URL);
      const responseData = await response.text();
      const rss = await rssParser.parse(responseData);
      const items = rss.items.map(parseRSSItem);
      const uniqueSources = Array.from(new Set(items.map(item => item.source))).sort();
      setRssItems(items);
      setSources(uniqueSources);
    } catch (err) {
      console.error('Error refreshing RSS feed:', err);
      setError(err);
    } finally {
      setRefreshing(false);
    }
  }, []);

  // Format date safely
  const formatDate = (date) => {
    try {
      if (date instanceof Date && !isNaN(date)) {
        return date.toLocaleDateString(locale, {
          year: 'numeric',
          month: 'long',
          day: 'numeric',
          hour: '2-digit',
          minute: '2-digit'
        });
      }
      return '';
    } catch (e) {
      return '';
    }
  };

  // Render RSS Item
  const renderRSSItem = useCallback(({ item }) => {
    const isHearted = userHearts[item.link];
    const heartCount = heartsCounts[item.link] || 0;
    const isRead = readStories.has(item.link);

    return (
      <TouchableOpacity 
        style={[styles.itemContainer, { backgroundColor: theme.lighterCardBackgroundColor }]}
        onPress={() => handleStoryPress(item)}
      >
        {item.thumbnail ? (
          <Image 
            source={{ uri: item.thumbnail }}
            style={[styles.thumbnail, isRead && styles.readStoryImage]}
            resizeMode="cover"
          />
        ) : (
          <View style={[styles.thumbnail, styles.noImage]}>
            <Ionicons name="image-outline" size={40} color="gray" />
          </View>
        )}
        <View style={styles.textContainer}>
          <Text style={[styles.titleArabic, { color: theme.textColor, fontFamily: 'NotoSansArabic-Regular' }]}>
            {item.title}
          </Text>
          <CustomTextR style={[styles.description, { color: theme.textColor }]}>
            {item.content ? item.content.replace(/<[^>]+>/g, '').substring(0, 100) + '...' : ''}
          </CustomTextR>
          <View style={styles.infoContainer}>
            <CustomTextB style={[styles.infoText, { color: theme.textColor }]}>
              {formatDate(item.pubDate)}
            </CustomTextB>
            {item.source && (
              <View style={styles.sourceContainer}>
                <CustomTextR style={[styles.sourceText, { color: theme.textColor }]}>
                  {item.source}
                </CustomTextR>
              </View>
            )}
            <View style={styles.heartContainer}>
              <Ionicons
                name={isHearted ? 'heart' : 'heart-outline'}
                color={isHearted ? 'red' : theme.textColor}
                size={16}
              />
              <CustomTextB style={[styles.heartCount, { color: theme.textColor }]}>
                {heartCount}
              </CustomTextB>
            </View>
          </View>
        </View>
      </TouchableOpacity>
    );
  }, [handleStoryPress, theme, readStories, userHearts, heartsCounts, locale]);

  // Source selection buttons
  const renderSourceButtons = () => (
    <ScrollView horizontal showsHorizontalScrollIndicator={false} style={styles.categoryContainer}>
      <TouchableOpacity
        style={[
          styles.categoryButton,
          selectedSource === 'all' && styles.selectedCategoryButton,
          { borderColor: theme.textColor }
        ]}
        onPress={() => setSelectedSource('all')}
      >
        <Text style={[styles.categoryText, { color: selectedSource === 'all' ? theme.primaryColor : theme.textColor }]}>
          {t('allSources')}
        </Text>
      </TouchableOpacity>
      {sources.map(source => (
        <TouchableOpacity
          key={source}
          style={[
            styles.categoryButton,
            selectedSource === source && styles.selectedCategoryButton,
            { borderColor: theme.textColor }
          ]}
          onPress={() => setSelectedSource(source)}
        >
          <Text style={[styles.categoryText, { color: selectedSource === source ? theme.primaryColor : theme.textColor }]}>
            {source}
          </Text>
        </TouchableOpacity>
      ))}
    </ScrollView>
  );

  // Filtered RSS Items based on selected source
  const getFilteredItems = () => {
    if (selectedSource === 'all') {
      return rssItems;
    }
    return rssItems.filter(item => item.source === selectedSource);
  };

  if (loading) {
    return (
      <View style={[styles.loadingContainer, { backgroundColor: theme.backgroundColor }]}>
        <ActivityIndicator size="large" color={theme.primaryColor} />
      </View>
    );
  }

  return (
    <View style={[styles.container, { backgroundColor: theme.backgroundColor }]}>
      <InternetStatusAlert
        visible={showInternetAlert}
        onDismiss={() => setShowInternetAlert(false)}
      />
      <FlatList
        ListHeaderComponent={renderSourceButtons}
        data={getFilteredItems()}
        renderItem={renderRSSItem}
        keyExtractor={item => item.link}
        refreshControl={
          <RefreshControl
            refreshing={refreshing}
            onRefresh={onRefresh}
            colors={[theme.primaryColor]}
          />
        }
        initialNumToRender={5}
        maxToRenderPerBatch={5}
        windowSize={11}
      />
    </View>
  );
};

const styles = StyleSheet.create({
  container: {
    flex: 1,
  },
  loadingContainer: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
  },
  itemContainer: {
    flexDirection: 'row',
    margin: 10,
    borderRadius: 10,
    overflow: 'hidden',
    elevation: 2,
  },
  thumbnail: {
    width: 100,
    height: 100,
  },
  noImage: {
    justifyContent: 'center',
    alignItems: 'center',
    backgroundColor: '#ccc',
  },
  readStoryImage: {
    opacity: 0.5,
  },
  textContainer: {
    flex: 1,
    padding: 10,
    justifyContent: 'space-between',
  },
  titleArabic: {
    fontSize: 16,
    fontWeight: 'bold',
    textAlign: 'right',
  },
  description: {
    fontSize: 12,
    marginTop: 5,
    textAlign: 'right',
  },
  infoContainer: {
    flexDirection: 'row',
    justifyContent: 'space-between',
    alignItems: 'center',
  },
  infoText: {
    fontSize: 10,
  },
  categoryContainer: {
    flexDirection: 'row',
    marginVertical: 10,
    paddingHorizontal: 10,
  },
  categoryButton: {
    paddingVertical: 6,
    paddingHorizontal: 12,
    borderWidth: 1,
    borderRadius: 20,
    marginRight: 10,
  },
  selectedCategoryButton: {
    backgroundColor: 'rgba(0,0,0,0.1)',
  },
  categoryText: {
    fontSize: 14,
    fontWeight: '600',
  },
  sourceContainer: {
    marginLeft: 8,
  },
  sourceText: {
    fontSize: 10,
  },
  heartContainer: {
    flexDirection: 'row',
    alignItems: 'center',
  },
  heartCount: {
    fontSize: 10,
    marginLeft: 4,
  },
});

export default RSSTabContent;" yapılacak değişiklikler:
"import React, { useState, useEffect, useCallback, useContext } from 'react';
import {
  View,
  Text,
  StyleSheet,
  FlatList,
  Image,
  TouchableOpacity,
  ActivityIndicator,
  RefreshControl,
  ScrollView,
} from 'react-native';
import { useThemeAndLanguage } from '../utils/ThemeAndLanguageContext';
import { useNavigation } from '@react-navigation/native';
import * as rssParser from 'react-native-rss-parser';
import AsyncStorage from '@react-native-async-storage/async-storage';
import { Ionicons } from '@expo/vector-icons';
import { CustomTextR, CustomTextB } from '../components/CustomText';
import { HeartContext } from './HeartContext';
import useInternetStatus from '../utils/useInternetStatus';
import InternetStatusAlert from '../components/InternetStatusAlert';

const RSS_URL = 'http://91.107.235.164:5000/feed.xml';
const STORAGE_KEY = '@rss_feed';
const READ_STORIES_KEY = '@readRSSStories';

const RSSTabContent = () => {
  // ... diğer state ve hook tanımlamaları aynı ...

  // Parse RSS item - Düzeltilmiş versiyon
  const parseRSSItem = (item) => {
    const defaultItem = {
      title: '',
      link: '',
      content: '',
      thumbnail: '',
      source: '',
      pubDate: new Date()
    };
  
    try {
      // XML'den gelen content'i parse et
      const content = item.content || item.description || '';
      
      // Thumbnail'i XML'den çek
      let thumbnail = '';
      if (content.includes('<thumbnail>')) {
        thumbnail = content.match(/<thumbnail>(.*?)<\/thumbnail>/)?.[1] || '';
      }
      
      // Source'u XML'den çek
      let source = '';
      if (content.includes('<source>')) {
        source = content.match(/<source>(.*?)<\/source>/)?.[1] || '';
      } else if (item.link) {
        // Eğer source XML'de yoksa link'ten çıkarmaya çalış
        source = item.link.match(/\/\/(.*?)\./)?.[1]?.replace('www.', '') || '';
      }

      // Tarihi parse et
      let pubDate;
      try {
        pubDate = item.pubDate ? new Date(item.pubDate) : new Date();
        if (isNaN(pubDate.getTime())) {
          pubDate = new Date();
        }
      } catch (e) {
        pubDate = new Date();
      }

      // HTML taglerini temizle
      const cleanContent = content.replace(/<[^>]+>/g, '');
  
      return {
        title: item.title || defaultItem.title,
        link: item.link || defaultItem.link,
        content: cleanContent,
        thumbnail: thumbnail,
        source: source,
        pubDate: pubDate
      };
    } catch (error) {
      console.warn('Error parsing RSS item:', error);
      return defaultItem;
    }
  };

  // Fetch RSS feed - Düzeltilmiş versiyon
  const fetchRSS = async () => {
    try {
      if (!isConnected) {
        setShowInternetAlert(true);
        setLoading(false);
        return;
      }

      const response = await fetch(RSS_URL);
      const responseData = await response.text();
      
      // XML'i manuel olarak parse et
      const parser = new DOMParser();
      const xmlDoc = parser.parseFromString(responseData, "text/xml");
      const items = xmlDoc.getElementsByTagName('item');
      
      const parsedItems = Array.from(items).map(item => {
        const title = item.getElementsByTagName('title')[0]?.textContent || '';
        const link = item.getElementsByTagName('link')[0]?.textContent || '';
        const content = item.getElementsByTagName('content')[0]?.textContent || '';
        const thumbnail = item.getElementsByTagName('thumbnail')[0]?.textContent || '';
        const source = item.getElementsByTagName('source')[0]?.textContent || '';
        const pubDate = item.getElementsByTagName('pubDate')[0]?.textContent || '';

        return parseRSSItem({
          title,
          link,
          content,
          thumbnail,
          source,
          pubDate
        });
      });

      setRssItems(parsedItems);
      const uniqueSources = Array.from(new Set(parsedItems.map(item => item.source))).sort();
      setSources(uniqueSources);
      setLoading(false);
    } catch (err) {
      console.error('Error fetching or parsing RSS feed:', err);
      setError(err);
      setLoading(false);
    }
  };

  // useEffect içinde fetchRSS'i çağır
  useEffect(() => {
    fetchRSS();
  }, [isConnected]);

  // Render RSS Item - Düzeltilmiş versiyon
  const renderRSSItem = useCallback(({ item }) => {
    const isHearted = userHearts[item.link];
    const heartCount = heartsCounts[item.link] || 0;
    const isRead = readStories.has(item.link);

    return (
      <TouchableOpacity 
        style={[styles.itemContainer, { backgroundColor: theme.lighterCardBackgroundColor }]}
        onPress={() => handleStoryPress(item)}
      >
        {item.thumbnail ? (
          <Image 
            source={{ uri: item.thumbnail }}
            style={[styles.thumbnail, isRead && styles.readStoryImage]}
            resizeMode="cover"
            defaultSource={require('../assets/placeholder.png')} // Placeholder image ekleyin
          />
        ) : (
          <View style={[styles.thumbnail, styles.noImage]}>
            <Ionicons name="image-outline" size={40} color="gray" />
          </View>
        )}
        <View style={styles.textContainer}>
          <Text style={[styles.titleArabic, { color: theme.textColor, fontFamily: 'NotoSansArabic-Regular' }]}>
            {item.title}
          </Text>
          <CustomTextR style={[styles.description, { color: theme.textColor }]}>
            {item.content ? item.content.substring(0, 100) + '...' : ''}
          </CustomTextR>
          <View style={styles.infoContainer}>
            <CustomTextB style={[styles.infoText, { color: theme.textColor }]}>
              {formatDate(item.pubDate)}
            </CustomTextB>
            {item.source && (
              <View style={styles.sourceContainer}>
                <CustomTextR style={[styles.sourceText, { color: theme.textColor }]}>
                  {item.source}
                </CustomTextR>
              </View>
            )}
            <View style={styles.heartContainer}>
              <Ionicons
                name={isHearted ? 'heart' : 'heart-outline'}
                color={isHearted ? 'red' : theme.textColor}
                size={16}
              />
              <CustomTextB style={[styles.heartCount, { color: theme.textColor }]}>
                {heartCount}
              </CustomTextB>
            </View>
          </View>
        </View>
      </TouchableOpacity>
    );
  }, [handleStoryPress, theme, readStories, userHearts, heartsCounts, locale]);

  // ... geri kalan kodlar aynı ...
};

export default RSSTabContent;"