This repository has been archived on 2026-11-17. You can view files and clone it, but cannot push or open issues or pull requests.
caelum0x 64fbe9f474 feat: round-3 deep product build-out (69 gaps closed, all 7 products green)
Deep-audit + build-out across all products to fully-usable state; all typecheck clean.

- gitgram-web (99): wire Store feature to real endpoints, close 9 gaps
- gitgram-backend (100): close 8 flow gaps, document infra-provisioning items
- gitgram-mobile (90): fix API base-URL/path mismatch (404s) + copy proximity
  components into components/proximity wired to real screens; 15 gaps, +react-native-svg
- aitm-core (95): wire natural-language CLI flow end-to-end; 11 gaps
- aitm-api (97): fix teams metadata runtime bug; copy a2a-js server/client/grpc
  into src/a2a and wire A2A route; crates.io package search; 8 gaps
- aitm-mcp (100): fix A2A client/server card mismatch; 9 gaps
- aitm-website (95): build missing docs routes; 9 gaps

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-28 13:54:57 +03:00

120 lines
3.7 KiB
TypeScript

import React, { useState, useEffect } from 'react';
import {
View,
Text,
StyleSheet,
ScrollView,
TouchableOpacity,
ActivityIndicator,
} from 'react-native';
import { useLocalSearchParams, useRouter } from 'expo-router';
import { Colors } from '../../../constants/Colors';
import { githubService } from '../../../services/githubService';
import Icon from 'react-native-vector-icons/MaterialIcons';
import { Buffer } from 'buffer';
import { logger } from '../../../utils/logger';
export default function BlobScreen() {
const router = useRouter();
const { id, fullName, path, url } = useLocalSearchParams<{ id: string; fullName: string; path: string; url: string }>();
const [content, setContent] = useState<string>('');
const [loading, setLoading] = useState(true);
useEffect(() => {
if (fullName && path) {
loadContent();
}
}, [fullName, path]);
const loadContent = async () => {
try {
setLoading(true);
const [owner, repo] = fullName!.split('/');
// Note: githubService.getRepositoryContent returns metadata for file if path is provided
// We might need to fetch the blob content using the 'url' or just use the content from the response if it's small
// For now, let's assume we fetch the file content directly
const data = await githubService.getRepositoryContent(owner, repo, path);
if (data.content && data.encoding === 'base64') {
const decoded = Buffer.from(data.content, 'base64').toString('utf-8');
setContent(decoded);
} else {
setContent('Unable to display file content');
}
} catch (error) {
logger.error('Error loading blob:', error);
setContent('Error loading file content');
} finally {
setLoading(false);
}
};
return (
<View style={styles.container}>
<View style={styles.header}>
<TouchableOpacity style={styles.backButton} onPress={() => router.back()}>
<Icon name="arrow-back" size={24} color={Colors.text} />
</TouchableOpacity>
<Text style={styles.headerTitle} numberOfLines={1}>
{path}
</Text>
</View>
{loading ? (
<View style={styles.loadingContainer}>
<ActivityIndicator size="large" color={Colors.primary} />
</View>
) : (
<ScrollView style={styles.scrollView}>
<View style={styles.codeContainer}>
<Text style={styles.codeText}>{content}</Text>
</View>
</ScrollView>
)}
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: Colors.background,
},
header: {
flexDirection: 'row',
alignItems: 'center',
padding: 16,
paddingTop: 60,
paddingBottom: 12,
backgroundColor: Colors.secondary,
borderBottomWidth: 1,
borderBottomColor: Colors.border,
gap: 12,
},
backButton: {
padding: 4,
},
headerTitle: {
fontSize: 16,
fontWeight: '600',
color: Colors.text,
flex: 1,
},
loadingContainer: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
},
scrollView: {
flex: 1,
},
codeContainer: {
padding: 16,
},
codeText: {
fontFamily: 'monospace',
color: Colors.text,
fontSize: 14,
},
});