Skip to content

Commit

Permalink
Added the possibility to export generated passwords to CSV (#842)
Browse files Browse the repository at this point in the history
  • Loading branch information
Leo-Peyronnet committed Feb 17, 2024
1 parent 196cf12 commit 66baf3c
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions pages/generate.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { useState } from "react"
import Head from "next/head"
import Link from "next/link"
import {
ArrowDownload20Regular,
BrainCircuit20Regular,
CheckmarkCircle20Filled,
CheckmarkCircle20Regular,
Expand Down Expand Up @@ -403,6 +405,22 @@ export default function IndexPage() {
>
{t("copy")}
</Button>
<Link
download="passwords.csv"
href={
"data:text/plain;charset=utf-8," +
encodeURIComponent(
multiplePasswordsTxt.replaceAll("\n", ",")
)
}
>
<Button
variant="outline"
className="h-auto px-2 py-1"
>
<ArrowDownload20Regular />
</Button>
</Link>
</div>
</div>
</DialogContent>
Expand Down

0 comments on commit 66baf3c

Please sign in to comment.