Files
imexmobile/components/data-label/data-label.component.jsx

29 lines
890 B
JavaScript

import { DateTime } from "luxon";
import { Input, Item, Label } from "native-base";
import React from "react";
import { StyleSheet } from "react-native";
import { connect } from "react-redux";
import { createStructuredSelector } from "reselect";
const mapStateToProps = createStructuredSelector({
//currentUser: selectCurrentUser
});
const mapDispatchToProps = (dispatch) => ({});
export function DataLabelComponent({ label, content, dateTime, ...restProps }) {
let theContent = content;
if (dateTime && content)
theContent = DateTime.fromISO(content).toLocaleString(
DateTime.DATETIME_SHORT
);
return (
<Item stackedLabel {...restProps}>
<Label>{label}</Label>
<Input disabled placeholder={theContent} />
</Item>
);
}
const localStyles = StyleSheet.create({});
export default connect(mapStateToProps, mapDispatchToProps)(DataLabelComponent);