Skip to content

Commit bb2bef1

Browse files
Dholanda/help (#217)
* Show need help page * Add helpbox
1 parent 7a3b9e1 commit bb2bef1

2 files changed

Lines changed: 77 additions & 0 deletions

File tree

website/src/app/playbooks/[id]/page.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import Header from "@/components/Header";
1414
import Footer from "@/components/Footer";
1515
import ImageLightbox from "@/components/ImageLightbox";
1616
import CodeLightbox from "@/components/CodeLightbox";
17+
import PlaybookHelpBox from "@/components/PlaybookHelpBox";
1718
import type { Playbook, Platform, Device, DeviceCategory, TestCoverageInfo, TestResultInfo } from "@/types/playbook";
1819
import { formatTime, DEVICE_IDS, deviceNames, extractPlatforms, extractDevices, extractCategories, extractCategoryDevices, DEVICE_CATEGORY_MAP, categoryForDevice } from "@/types/playbook";
1920

@@ -2039,6 +2040,11 @@ export default function PlaybookPage({ params, searchParams }: { params: Promise
20392040
</div>
20402041
)}
20412042
</div>
2043+
2044+
{/* Need help? — links to GitHub issues */}
2045+
{filteredContent && (
2046+
<PlaybookHelpBox playbookTitle={playbook.title} />
2047+
)}
20422048
</div>
20432049

20442050
{/* Mobile-only coverage toggle */}
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
interface PlaybookHelpBoxProps {
2+
playbookTitle?: string;
3+
}
4+
5+
const REPO_URL = "https://github.com/amd/playbooks";
6+
7+
export default function PlaybookHelpBox({ playbookTitle }: PlaybookHelpBoxProps) {
8+
const issueTitle = playbookTitle ? `Help with: ${playbookTitle}` : "";
9+
const newIssueHref = issueTitle
10+
? `${REPO_URL}/issues/new?title=${encodeURIComponent(issueTitle)}`
11+
: `${REPO_URL}/issues/new`;
12+
const browseIssuesHref = `${REPO_URL}/issues`;
13+
14+
return (
15+
<div className="mt-6 bg-gradient-to-r from-[#2a1f1a] via-[#1e1e1e] to-[#1e1e1e] border border-[#333333] rounded-xl p-6 flex flex-col md:flex-row md:items-center justify-between gap-5">
16+
<div className="flex items-start gap-4">
17+
<div className="flex-shrink-0 w-10 h-10 rounded-lg bg-[#D4915D]/10 border border-[#D4915D]/30 flex items-center justify-center text-[#D4915D]">
18+
<svg
19+
className="w-5 h-5"
20+
viewBox="0 0 24 24"
21+
fill="currentColor"
22+
aria-hidden="true"
23+
>
24+
<path d="M12 .5C5.65.5.5 5.65.5 12c0 5.08 3.29 9.39 7.86 10.91.58.11.79-.25.79-.56 0-.27-.01-1.16-.02-2.11-3.2.7-3.87-1.36-3.87-1.36-.52-1.33-1.27-1.69-1.27-1.69-1.04-.71.08-.7.08-.7 1.15.08 1.76 1.18 1.76 1.18 1.02 1.75 2.69 1.24 3.34.95.1-.74.4-1.24.73-1.53-2.55-.29-5.24-1.28-5.24-5.69 0-1.26.45-2.28 1.18-3.09-.12-.29-.51-1.46.11-3.04 0 0 .96-.31 3.16 1.18a10.94 10.94 0 0 1 5.76 0c2.2-1.49 3.16-1.18 3.16-1.18.62 1.58.23 2.75.11 3.04.74.81 1.18 1.83 1.18 3.09 0 4.42-2.69 5.4-5.25 5.68.41.36.78 1.05.78 2.12 0 1.53-.01 2.76-.01 3.14 0 .31.21.68.8.56C20.21 21.39 23.5 17.08 23.5 12 23.5 5.65 18.35.5 12 .5Z" />
25+
</svg>
26+
</div>
27+
<div>
28+
<h3 className="text-lg font-semibold text-white mb-1">
29+
Need help with this playbook?
30+
</h3>
31+
<p className="text-sm text-[#a0a0a0] leading-relaxed">
32+
Run into an issue or have a question? Open a GitHub issue and our
33+
team will take a look.
34+
</p>
35+
</div>
36+
</div>
37+
<div className="flex flex-col sm:flex-row items-stretch sm:items-center gap-2 md:flex-shrink-0">
38+
<a
39+
href={browseIssuesHref}
40+
target="_blank"
41+
rel="noopener noreferrer"
42+
className="inline-flex items-center justify-center gap-2 px-4 py-2.5 text-sm bg-[#242424] hover:bg-[#2f2f2f] text-[#d0d0d0] font-medium rounded-lg border border-[#333333] hover:border-[#444] transition-colors whitespace-nowrap"
43+
>
44+
Browse Issues
45+
</a>
46+
<a
47+
href={newIssueHref}
48+
target="_blank"
49+
rel="noopener noreferrer"
50+
className="inline-flex items-center justify-center gap-2 px-4 py-2.5 text-sm bg-[#D4915D] hover:bg-[#B8784A] text-black font-medium rounded-lg transition-colors whitespace-nowrap"
51+
>
52+
Open an Issue
53+
<svg
54+
className="w-3.5 h-3.5"
55+
fill="none"
56+
stroke="currentColor"
57+
viewBox="0 0 24 24"
58+
aria-hidden="true"
59+
>
60+
<path
61+
strokeLinecap="round"
62+
strokeLinejoin="round"
63+
strokeWidth={2}
64+
d="M14 5l7 7m0 0l-7 7m7-7H3"
65+
/>
66+
</svg>
67+
</a>
68+
</div>
69+
</div>
70+
);
71+
}

0 commit comments

Comments
 (0)