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!');
|
||||
|
||||
Reference in New Issue
Block a user