Files
imexmobile/components/data-label/data-label.component.js
2022-01-12 14:22:13 -08:00

25 lines
543 B
JavaScript

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