Basic job details.
This commit is contained in:
24
components/data-label/data-label.jsx
Normal file
24
components/data-label/data-label.jsx
Normal file
@@ -0,0 +1,24 @@
|
||||
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
|
||||
);
|
||||
const { key, ...rest } = restProps;
|
||||
return (
|
||||
<View key={key} {...rest} style={{ margin: 4, ...restProps.style }}>
|
||||
<Text style={{ color: "slategray" }}>{label}</Text>
|
||||
<Text>{theContent}</Text>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user