Files
imexmobile/components/data-label/data-label.jsx
2025-10-23 13:44:33 -07:00

26 lines
591 B
JavaScript

import { DateTime } from "luxon";
import React from "react";
import { View } from "react-native";
import { Text } from "react-native-paper";
export default function DataLabelComponent({
label,
content,
dateTime,
...restProps
}) {
let theContent = content;
if (dateTime && content)
theContent = DateTime.fromISO(content).toLocaleString(
DateTime.DATETIME_SHORT
);
const { key, ...rest } = restProps;
return (
<View key={key} {...rest} style={{ margin: 4, ...restProps.style }}>
<Text>{label}</Text>
<Text>{theContent}</Text>
</View>
);
}