Files
imexmobile/components/data-label/data-label.component.jsx
2021-05-04 10:26:24 -07:00

25 lines
503 B
JavaScript

import { DateTime } from "luxon";
import React from "react";
import { Text, TextInput, 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}>
<TextInput disabled placeholder={label} />
<Text>{theContent}</Text>
</View>
);
}