Skip to content

Commit 9275f3b

Browse files
committed
feat: docs for feature flags in page header
1 parent 74f5eba commit 9275f3b

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

apps/dashboard/app/(main)/websites/[id]/_components/website-page-header.tsx

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import {
44
ArrowClockwiseIcon,
55
ArrowLeftIcon,
6+
BookIcon,
67
PlusIcon,
78
} from '@phosphor-icons/react';
89
import Link from 'next/link';
@@ -35,6 +36,8 @@ interface WebsitePageHeaderProps {
3536
variant?: 'default' | 'minimal';
3637

3738
additionalActions?: ReactNode;
39+
40+
docsUrl?: string;
3841
}
3942

4043
export function WebsitePageHeader({
@@ -53,6 +56,7 @@ export function WebsitePageHeader({
5356
showBackButton = false,
5457
variant = 'default',
5558
additionalActions,
59+
docsUrl,
5660
}: WebsitePageHeaderProps) {
5761
const renderSubtitle = () => {
5862
if (isLoading) {
@@ -103,6 +107,19 @@ export function WebsitePageHeader({
103107
</div>
104108

105109
<div className="flex items-center gap-3">
110+
{docsUrl && (
111+
<Button asChild variant="outline">
112+
<Link
113+
className="cursor-pointer gap-2 transition-all duration-300 hover:border-primary/50 hover:bg-primary/5"
114+
href={docsUrl}
115+
rel="noopener noreferrer"
116+
target="_blank"
117+
>
118+
<BookIcon size={16} weight="duotone" />
119+
<span className="xs:inline hidden">Docs</span>
120+
</Link>
121+
</Button>
122+
)}
106123
{onRefresh && (
107124
<Button
108125
className="cursor-pointer gap-2 transition-all duration-300 hover:border-primary/50 hover:bg-primary/5"
@@ -149,6 +166,19 @@ export function WebsitePageHeader({
149166
</div>
150167
</div>
151168
<div className="flex items-center gap-3">
169+
{docsUrl && (
170+
<Button asChild variant="outline">
171+
<Link
172+
className="cursor-pointer select-none gap-2 border-border/50"
173+
href={docsUrl}
174+
rel="noopener noreferrer"
175+
target="_blank"
176+
>
177+
<BookIcon size={16} />
178+
Documentation
179+
</Link>
180+
</Button>
181+
)}
152182
{onRefresh && (
153183
<Button
154184
className="cursor-pointer select-none gap-2 border-border/50"

apps/dashboard/app/(main)/websites/[id]/flags/page.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ export default function FlagsPage() {
122122
<WebsitePageHeader
123123
createActionLabel="Create Flag"
124124
description="Control feature rollouts and A/B testing"
125+
docsUrl="https://www.databuddy.cc/docs/features/feature-flags"
125126
hasError={!!flagsError}
126127
icon={
127128
<FlagIcon

0 commit comments

Comments
 (0)