Skip to content

Commit

Permalink
🐛 Show first non-empty line in incident message overflow tab
Browse files Browse the repository at this point in the history
  • Loading branch information
ibolton336 committed Apr 11, 2024
1 parent d929226 commit 12d7779
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export const FileAllIncidentsTable: React.FC<
{...getTdProps({ columnKey: "message" })}
>
<ReactMarkdown components={markdownPFComponents}>
{`${incident.message.split("\n")[0]} ...`}
{`${getFirstNonEmptyLine(incident.message)} ...`}
</ReactMarkdown>
</Td>
</TableRowContentWithControls>
Expand All @@ -143,3 +143,8 @@ export const FileAllIncidentsTable: React.FC<
</>
);
};

const getFirstNonEmptyLine = (message: string) => {
const lines = message.split("\n");
return lines.find((line) => line.trim() !== "") || "No content available.";
};

0 comments on commit 12d7779

Please sign in to comment.