update data formatting when copying to clipboard ivans or rs
This commit is contained in:
@@ -113,7 +113,13 @@ export default function IvansAlerts({ settings, widgetID }) {
|
||||
|
||||
useEffect(() => {
|
||||
if(isCopy) {
|
||||
const dataText = JSON.stringify(data); // TODO: this is pretty ugly when copied and pasted, format it better
|
||||
const dataText = data.map((item) => {
|
||||
return `${item.volcano_name}\n` +
|
||||
`Report Number: ${item.report_num}\n` +
|
||||
`Send Time: ${item.send_time}\n` +
|
||||
`Preparer: ${item.preparer}\n` +
|
||||
`Summary:\n${item.summary}\n`;
|
||||
}).join('\n\n');
|
||||
navigator.clipboard.writeText(dataText)
|
||||
.then(() => {
|
||||
alert('Copied to clipboard!');
|
||||
|
||||
@@ -123,7 +123,12 @@ export default function RemoteSensing({ settings, widgetID }) {
|
||||
|
||||
useEffect(() => {
|
||||
if(isCopy) {
|
||||
const dataText = JSON.stringify(data); // TODO: this is pretty ugly when copied and pasted, format it better
|
||||
const dataText = data.map((item) => {
|
||||
return `${item.country}, ${item.volcano_name}\n` +
|
||||
`Report Time: ${item.report_time}\n` +
|
||||
`Sender: ${item.sender}\n` +
|
||||
`Summary:\n${item.summary}\n`;
|
||||
}).join('\n\n');
|
||||
navigator.clipboard.writeText(dataText)
|
||||
.then(() => {
|
||||
alert('Copied to clipboard!');
|
||||
@@ -180,11 +185,11 @@ export default function RemoteSensing({ settings, widgetID }) {
|
||||
borderBottomRadius={collapsible.open ? "0" : "lg"}
|
||||
bg="gray.700"
|
||||
>
|
||||
<Flex direction="column" minW={0} pl={3} textAlign="left" color="gray.100">
|
||||
<Flex direction="column" w="100%" minW={0} pl={3} textAlign="left" color="gray.100">
|
||||
<Text truncate >{item?.volcano_name}</Text>
|
||||
<Text truncate fontSize="xs" color="gray.300/90">{item?.country}</Text>
|
||||
</Flex>
|
||||
<Flex pr={3} minW={0}>
|
||||
<Flex pr={3} minW={0} w="100%">
|
||||
<Text truncate pl={2} pr={2} borderRadius="lg" bg="gray.800/50" color="gray.100" fontSize="sm">{item?.report_time}</Text>
|
||||
</Flex>
|
||||
</Flex>
|
||||
|
||||
Reference in New Issue
Block a user