import { expandCellAtom } from '../atoms'; import { useAtom } from 'jotai'; import React, { useEffect } from 'react'; import { View, StyleSheet } from 'react-native'; import { ScrollView } from 'react-native-gesture-handler'; import { DataTable, Text } from 'react-native-paper'; import Cell from './Cell'; const DATA_TABLE_HEADER_HEIGHT = 48; const ExpandedTableCell = () => { const [expandedCell, setExpandedCell] = useAtom(expandCellAtom); useEffect(() => { return () => { setExpandedCell({ expand: false }); }; }, [setExpandedCell]); return ( {expandedCell.titles?.[0] ?? 'Column Value'} {expandedCell.titles?.[1] ?? 'Row Value'} {expandedCell.data?.col.map((item: any, index: number) => ( {item.label} ))} ); }; const styles = StyleSheet.create({ header: { height: DATA_TABLE_HEADER_HEIGHT, }, title: { paddingHorizontal: 8, }, titleTextStyle: { color: '#404040', fontSize: 16, fontWeight: 'bold', }, cell: { flex: 1, padding: 8, }, }); export default ExpandedTableCell;