Home Reference Source

src/views/journal/components/TableCell.js

/**
 * Component representing a content cell in a table.
 */
import React from 'react';
import {Text} from 'react-native';
import {DataTable} from 'react-native-paper';

import {iOSTypography} from '../../../styles/Typography';

/**
 * Component representing a cell in a table.
 * @param {Object} props - Properties
 * @param {Object} props.style - Style of the table cell
 * @param {string} props.text - Content of the table cell
 * @returns {Object} Table cell
 */
export default function TableCell(props) {
    // Retrieve props
    const style = props.style;
    const text = props.text;

    return (
        <DataTable.Cell style={style}>
            <Text style={iOSTypography.body}>{text}</Text>
        </DataTable.Cell>
    );
}