1- import {
2- BookOpenIcon ,
3- ChatCircleIcon ,
4- LaptopIcon ,
5- } from '@phosphor-icons/react' ;
1+ import { BookOpenIcon , ChatCircleIcon , PlayIcon } from '@phosphor-icons/react' ;
62import Link from 'next/link' ;
73import { Button } from '@/components/ui/button' ;
84import {
@@ -18,77 +14,75 @@ interface HelpDialogProps {
1814 onOpenChange : ( open : boolean ) => void ;
1915}
2016
17+ const helpItems = [
18+ {
19+ href : 'https://databuddy.com/docs' ,
20+ icon : BookOpenIcon ,
21+ title : 'Documentation' ,
22+ description : 'Read guides and API references' ,
23+ external : true ,
24+ } ,
25+ {
26+ 27+ icon : ChatCircleIcon ,
28+ title : 'Contact Support' ,
29+ description : 'Get help from our support team' ,
30+ external : false ,
31+ } ,
32+ {
33+ href : 'https://www.youtube.com/@trydatabuddy' ,
34+ icon : PlayIcon ,
35+ title : 'Tutorials' ,
36+ description : 'Learn Databuddy step by step' ,
37+ external : true ,
38+ } ,
39+ ] as const ;
40+
2141export function HelpDialog ( { open, onOpenChange } : HelpDialogProps ) {
2242 return (
2343 < Dialog onOpenChange = { onOpenChange } open = { open } >
24- < DialogContent className = "sm:max-w-[425px] " >
25- < DialogHeader >
44+ < DialogContent className = "sm:max-w-md " >
45+ < DialogHeader className = "text-center" >
2646 < DialogTitle > Help & Resources </ DialogTitle >
2747 < DialogDescription >
2848 Get assistance and learn more about Databuddy
2949 </ DialogDescription >
3050 </ DialogHeader >
31- < div className = "grid gap-3 py-4" >
32- < Link href = "https://databuddy.com/docs" target = "_blank" >
33- < Button
34- className = "h-auto justify-start py-3 text-left"
35- variant = "outline"
36- >
37- < div className = "flex items-start gap-3" >
38- < BookOpenIcon
39- className = "mt-0.5 h-5 w-5 flex-shrink-0 text-primary"
40- size = { 32 }
41- weight = "duotone"
42- />
43- < div >
44- < h4 className = "font-medium text-sm" > Documentation</ h4 >
45- < span className = "mt-1 block text-muted-foreground text-xs" >
46- Read guides and API references
47- </ span >
48- </ div >
49- </ div >
50- </ Button >
51- </ Link >
52- < Link href = "mailto:[email protected] " target = "_blank" > 53- < Button
54- className = "h-auto justify-start py-3 text-left"
55- variant = "outline"
56- >
57- < div className = "flex items-start gap-3" >
58- < ChatCircleIcon
59- className = "mt-0.5 h-5 w-5 flex-shrink-0 text-primary"
60- size = { 32 }
61- weight = "duotone"
62- />
63- < div >
64- < h4 className = "font-medium text-sm" > Contact Support</ h4 >
65- < span className = "mt-1 block text-muted-foreground text-xs" >
66- Get help from our support team
67- </ span >
68- </ div >
69- </ div >
70- </ Button >
71- </ Link >
72- < Link href = "https://www.youtube.com/trydatabuddy" target = "_blank" >
73- < Button
74- className = "h-auto justify-start py-3 text-left"
75- variant = "outline"
76- >
77- < div className = "flex items-start gap-3" >
78- < LaptopIcon
79- className = "mt-0.5 h-5 w-5 flex-shrink-0 text-primary"
80- size = { 32 }
81- weight = "duotone"
82- />
83- < div >
84- < h4 className = "font-medium text-sm" > Tutorials</ h4 >
85- < span className = "mt-1 block text-muted-foreground text-xs" >
86- Learn Databuddy step by step
87- </ span >
88- </ div >
89- </ div >
90- </ Button >
91- </ Link >
51+
52+ < div className = "space-y-2 py-4" >
53+ { helpItems . map ( ( item ) => {
54+ const Icon = item . icon ;
55+ return (
56+ < Link
57+ href = { item . href }
58+ key = { item . href }
59+ { ...( item . external && {
60+ target : '_blank' ,
61+ rel : 'noopener noreferrer' ,
62+ } ) }
63+ className = "block"
64+ >
65+ < Button
66+ className = "h-auto w-full justify-start p-4 text-left transition-colors hover:bg-muted/50"
67+ variant = "ghost"
68+ >
69+ < div className = "flex items-start gap-4" >
70+ < div className = "rounded-lg bg-primary/10 p-2" >
71+ < Icon className = "h-5 w-5 text-primary" weight = "duotone" />
72+ </ div >
73+ < div className = "min-w-0 flex-1" >
74+ < h4 className = "font-semibold text-sm leading-none" >
75+ { item . title }
76+ </ h4 >
77+ < p className = "mt-2 text-muted-foreground text-xs leading-relaxed" >
78+ { item . description }
79+ </ p >
80+ </ div >
81+ </ div >
82+ </ Button >
83+ </ Link >
84+ ) ;
85+ } ) }
9286 </ div >
9387 </ DialogContent >
9488 </ Dialog >
0 commit comments