1
1
import React from "react" ;
2
2
import { ScrollArea } from "@radix-ui/react-scroll-area" ;
3
- import { PaintBucket } from "lucide-react" ;
3
+ import {
4
+ PaintBucket ,
5
+ Settings2Icon ,
6
+ SlidersHorizontalIcon ,
7
+ } from "lucide-react" ;
4
8
import { getFileSource } from "@/lib/get-file-source" ;
5
9
import { cn } from "@/lib/utils" ;
6
10
import { Button } from "@/components/core/button" ;
@@ -25,6 +29,7 @@ export interface ComponentPreviewProps {
25
29
fullWidth ?: boolean ;
26
30
resizable ?: boolean ;
27
31
suspense ?: boolean ;
32
+ primary ?: boolean ;
28
33
}
29
34
30
35
export const ComponentPreview = async ( {
@@ -35,6 +40,7 @@ export const ComponentPreview = async ({
35
40
fullWidth = false ,
36
41
resizable = false ,
37
42
suspense = false ,
43
+ primary = false ,
38
44
} : ComponentPreviewProps ) => {
39
45
const demoItem = Index [ name ] ;
40
46
@@ -55,33 +61,49 @@ export const ComponentPreview = async ({
55
61
< div
56
62
className = { cn ( "overflow-hidden rounded-md border" , containerClassName ) }
57
63
>
64
+ { /* <div className="bg-bg-muted flex items-center justify-between rounded-t-[inherit] border-b p-2">
65
+ <StyleSwitcher
66
+ // @ts -expect-error TODO fix later
67
+ componentName={getComponentName(name)}
68
+ variant="outline"
69
+ className="bg-bg-inverse/5 h-7 text-xs font-normal"
70
+ />
71
+ <ThemeCustomizerDialog>
72
+ <Tooltip
73
+ content={
74
+ <span>
75
+ <span className="text-fg-muted">Theme:</span> dotUI
76
+ </span>
77
+ }
78
+ >
79
+ <Button
80
+ variant="outline"
81
+ shape="square"
82
+ size="sm"
83
+ className="bg-bg-inverse/5 size-7 text-sm font-normal"
84
+ >
85
+ <PaintBucket />
86
+ </Button>
87
+ </Tooltip>
88
+ </ThemeCustomizerDialog>
89
+ </div> */ }
58
90
< div className = "bg-bg-muted" >
59
91
< ResizableContainer resizable = { resizable } >
60
92
< Loader >
61
93
< ThemeOverride className = "relative duration-300" >
62
- { /* @ts -expect-error fix later */ }
63
- < StyleSwitcher componentName = { getComponentName ( name ) } />
64
- < ThemeCustomizerDialog >
65
- < Tooltip
66
- content = {
67
- < span >
68
- < span className = "text-fg-muted" > Theme:</ span > dotUI
69
- </ span >
70
- }
71
- >
72
- < Button
73
- shape = "square"
74
- size = "sm"
75
- className = "border-border absolute right-2 top-2 z-10 font-normal"
76
- >
77
- < PaintBucket />
78
- </ Button >
79
- </ Tooltip >
80
- </ ThemeCustomizerDialog >
94
+ < Button
95
+ variant = "quiet"
96
+ shape = "square"
97
+ size = "sm"
98
+ className = "absolute right-2 top-2 z-10"
99
+ >
100
+ < SlidersHorizontalIcon />
101
+ </ Button >
81
102
< ScrollArea className = "bg-bg text-fg" >
82
103
< div
83
104
className = { cn (
84
- "flex min-h-52 py-20" ,
105
+ "flex py-10" ,
106
+ primary && "min-h-48 py-20" ,
85
107
fullWidth
86
108
? "px-8 lg:px-12"
87
109
: "flex items-center justify-center px-4"
0 commit comments