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}>
      <Text>{label}</Text>
      <TextInput disabled placeholder={theContent} />
    </View>
  );
}
