Skip to content

Commit

Permalink
add a way to download the raw answer
Browse files Browse the repository at this point in the history
  • Loading branch information
aeltorio committed Oct 30, 2024
1 parent b40fea2 commit 2fead36
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
14 changes: 13 additions & 1 deletion src/aipane/components/TextInsertion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ const useStyles = makeStyles({
display: "block",
maxWidth: "1024px",
},
downloadLink: {
display: "block",
marginTop: "0.5em",
},
});

/**
Expand Down Expand Up @@ -166,7 +170,15 @@ const TextInsertion: React.FC<TextInsertionProps> = (props: TextInsertionProps):
<Markdown className={styles.markdown} rehypePlugins={[rehypeHighlight]}>
{answer}
</Markdown>
&nbsp;
{!isOutlook && answer && answer.length ? (
<a
href={`data:text/plain;charset=utf-8,${encodeURIComponent(answer)}`}
download="answer.md"
className={styles.downloadLink}
>
Download Raw Answer
</a>
) : null}
</div>
</div>
);
Expand Down
4 changes: 2 additions & 2 deletions src/version.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const versionInfo = {
commit: "266fed5e64f0f31d6565bb96ab3be3c52d2384b3",
date: "2024-10-30 18:30:13 +0100",
commit: "b40fea2efa5d8633a8fe5c3f0fc3bd78992a2bc8",
date: "2024-10-30 18:33:47 +0100",
};

0 comments on commit 2fead36

Please sign in to comment.