File tree Expand file tree Collapse file tree 2 files changed +38
-2
lines changed Expand file tree Collapse file tree 2 files changed +38
-2
lines changed Original file line number Diff line number Diff line change 1+ "use client" ;
2+
3+ import { Link } from "@navikt/ds-react" ;
4+
5+ interface Props {
6+ labels : string ;
7+ template : "bug-report.md" ;
8+ title : string ;
9+ includeUrlInBody ?: boolean ;
10+ children : React . ReactNode ;
11+ }
12+
13+ export default function GitHubIssueLink ( {
14+ labels,
15+ template,
16+ title,
17+ includeUrlInBody,
18+ children,
19+ } : Props ) {
20+ const url = typeof window === "undefined" ? "" : window . location . href ;
21+
22+ const href =
23+ "https://github.com/navikt/aksel/issues/new?" +
24+ `labels=${ encodeURIComponent ( labels ) } ` +
25+ `&template=${ template } ` +
26+ `&title=${ encodeURIComponent ( title ) } ` +
27+ `${ includeUrlInBody ? `&body=${ encodeURIComponent ( `URL: ${ url } ` ) } ` : "" } ` ;
28+
29+ return < Link href = { href } > { children } </ Link > ;
30+ }
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import Footer from "@/app/_ui/footer/Footer";
55import { Header } from "@/app/_ui/header/Header" ;
66import { WebsiteList , WebsiteListItem } from "@/app/_ui/typography/WebsiteList" ;
77import { UmamiNotFoundPageLog } from "@/app/_ui/umami/Umami.log" ;
8+ import GitHubIssueLink from "./_ui/github-issue-link" ;
89
910export default function NotFound ( ) {
1011 return (
@@ -37,10 +38,15 @@ export default function NotFound() {
3738 </ WebsiteListItem >
3839 </ WebsiteList >
3940 </ div >
40- < Link href = "https://github.com/navikt/aksel/issues/new?assignees=& labels = bug + % F0 % 9 F % 90 % 9 B & projects = & template = bug - report . md & title = [ Aksel . nav . no % 20 - % 20404 ] " >
41+ < GitHubIssueLink
42+ labels = "bug 🐛"
43+ template = "bug-report.md"
44+ title = "[Aksel.nav.no - 404]"
45+ includeUrlInBody
46+ >
4147 < BugIcon aria-hidden />
4248 Meld gjerne fra om at lenken ikke virker
43- </ Link >
49+ </ GitHubIssueLink >
4450 </ VStack >
4551
4652 < div >
You can’t perform that action at this time.
0 commit comments