Skip to content

Commit eaaf80b

Browse files
committed
fix: format
1 parent b323a97 commit eaaf80b

33 files changed

+3665
-3672
lines changed
Lines changed: 50 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,65 @@
1-
"use client";
1+
'use client';
22

3-
import { Button } from "@/components/ui/button";
3+
import { Button } from '@/components/ui/button';
44
import {
5-
Tooltip,
6-
TooltipContent,
7-
TooltipProvider,
8-
TooltipTrigger,
9-
} from "@/components/ui/tooltip";
10-
import { cn } from "@/lib/utils";
11-
import type { ComponentProps } from "react";
5+
Tooltip,
6+
TooltipContent,
7+
TooltipProvider,
8+
TooltipTrigger,
9+
} from '@/components/ui/tooltip';
10+
import { cn } from '@/lib/utils';
11+
import type { ComponentProps } from 'react';
1212

13-
export type ActionsProps = ComponentProps<"div">;
13+
export type ActionsProps = ComponentProps<'div'>;
1414

1515
export const Actions = ({ className, children, ...props }: ActionsProps) => (
16-
<div className={cn("flex items-center gap-1", className)} {...props}>
17-
{children}
18-
</div>
16+
<div className={cn('flex items-center gap-1', className)} {...props}>
17+
{children}
18+
</div>
1919
);
2020

2121
export type ActionProps = ComponentProps<typeof Button> & {
22-
tooltip?: string;
23-
label?: string;
22+
tooltip?: string;
23+
label?: string;
2424
};
2525

2626
export const Action = ({
27-
tooltip,
28-
children,
29-
label,
30-
className,
31-
variant = "ghost",
32-
size = "sm",
33-
...props
27+
tooltip,
28+
children,
29+
label,
30+
className,
31+
variant = 'ghost',
32+
size = 'sm',
33+
...props
3434
}: ActionProps) => {
35-
const button = (
36-
<Button
37-
className={cn(
38-
"relative size-9 p-1.5 text-muted-foreground hover:text-foreground",
39-
className
40-
)}
41-
size={size}
42-
type="button"
43-
variant={variant}
44-
{...props}
45-
>
46-
{children}
47-
<span className="sr-only">{label || tooltip}</span>
48-
</Button>
49-
);
35+
const button = (
36+
<Button
37+
className={cn(
38+
'relative size-9 p-1.5 text-muted-foreground hover:text-foreground',
39+
className
40+
)}
41+
size={size}
42+
type="button"
43+
variant={variant}
44+
{...props}
45+
>
46+
{children}
47+
<span className="sr-only">{label || tooltip}</span>
48+
</Button>
49+
);
5050

51-
if (tooltip) {
52-
return (
53-
<TooltipProvider>
54-
<Tooltip>
55-
<TooltipTrigger asChild>{button}</TooltipTrigger>
56-
<TooltipContent>
57-
<p>{tooltip}</p>
58-
</TooltipContent>
59-
</Tooltip>
60-
</TooltipProvider>
61-
);
62-
}
51+
if (tooltip) {
52+
return (
53+
<TooltipProvider>
54+
<Tooltip>
55+
<TooltipTrigger asChild>{button}</TooltipTrigger>
56+
<TooltipContent>
57+
<p>{tooltip}</p>
58+
</TooltipContent>
59+
</Tooltip>
60+
</TooltipProvider>
61+
);
62+
}
6363

64-
return button;
64+
return button;
6565
};
Lines changed: 98 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -1,147 +1,147 @@
1-
"use client";
1+
'use client';
22

3-
import { Button } from "@/components/ui/button";
3+
import { Button } from '@/components/ui/button';
44
import {
5-
Tooltip,
6-
TooltipContent,
7-
TooltipProvider,
8-
TooltipTrigger,
9-
} from "@/components/ui/tooltip";
10-
import { cn } from "@/lib/utils";
11-
import { type LucideIcon, XIcon } from "lucide-react";
12-
import type { ComponentProps, HTMLAttributes } from "react";
5+
Tooltip,
6+
TooltipContent,
7+
TooltipProvider,
8+
TooltipTrigger,
9+
} from '@/components/ui/tooltip';
10+
import { cn } from '@/lib/utils';
11+
import { type LucideIcon, XIcon } from 'lucide-react';
12+
import type { ComponentProps, HTMLAttributes } from 'react';
1313

1414
export type ArtifactProps = HTMLAttributes<HTMLDivElement>;
1515

1616
export const Artifact = ({ className, ...props }: ArtifactProps) => (
17-
<div
18-
className={cn(
19-
"flex flex-col overflow-hidden rounded-lg border bg-background shadow-sm",
20-
className
21-
)}
22-
{...props}
23-
/>
17+
<div
18+
className={cn(
19+
'flex flex-col overflow-hidden rounded-lg border bg-background shadow-sm',
20+
className
21+
)}
22+
{...props}
23+
/>
2424
);
2525

2626
export type ArtifactHeaderProps = HTMLAttributes<HTMLDivElement>;
2727

2828
export const ArtifactHeader = ({
29-
className,
30-
...props
29+
className,
30+
...props
3131
}: ArtifactHeaderProps) => (
32-
<div
33-
className={cn(
34-
"flex items-center justify-between border-b bg-muted/50 px-4 py-3",
35-
className
36-
)}
37-
{...props}
38-
/>
32+
<div
33+
className={cn(
34+
'flex items-center justify-between border-b bg-muted/50 px-4 py-3',
35+
className
36+
)}
37+
{...props}
38+
/>
3939
);
4040

4141
export type ArtifactCloseProps = ComponentProps<typeof Button>;
4242

4343
export const ArtifactClose = ({
44-
className,
45-
children,
46-
size = "sm",
47-
variant = "ghost",
48-
...props
44+
className,
45+
children,
46+
size = 'sm',
47+
variant = 'ghost',
48+
...props
4949
}: ArtifactCloseProps) => (
50-
<Button
51-
className={cn(
52-
"size-8 p-0 text-muted-foreground hover:text-foreground",
53-
className
54-
)}
55-
size={size}
56-
type="button"
57-
variant={variant}
58-
{...props}
59-
>
60-
{children ?? <XIcon className="size-4" />}
61-
<span className="sr-only">Close</span>
62-
</Button>
50+
<Button
51+
className={cn(
52+
'size-8 p-0 text-muted-foreground hover:text-foreground',
53+
className
54+
)}
55+
size={size}
56+
type="button"
57+
variant={variant}
58+
{...props}
59+
>
60+
{children ?? <XIcon className="size-4" />}
61+
<span className="sr-only">Close</span>
62+
</Button>
6363
);
6464

6565
export type ArtifactTitleProps = HTMLAttributes<HTMLParagraphElement>;
6666

6767
export const ArtifactTitle = ({ className, ...props }: ArtifactTitleProps) => (
68-
<p
69-
className={cn("font-medium text-foreground text-sm", className)}
70-
{...props}
71-
/>
68+
<p
69+
className={cn('font-medium text-foreground text-sm', className)}
70+
{...props}
71+
/>
7272
);
7373

7474
export type ArtifactDescriptionProps = HTMLAttributes<HTMLParagraphElement>;
7575

7676
export const ArtifactDescription = ({
77-
className,
78-
...props
77+
className,
78+
...props
7979
}: ArtifactDescriptionProps) => (
80-
<p className={cn("text-muted-foreground text-sm", className)} {...props} />
80+
<p className={cn('text-muted-foreground text-sm', className)} {...props} />
8181
);
8282

8383
export type ArtifactActionsProps = HTMLAttributes<HTMLDivElement>;
8484

8585
export const ArtifactActions = ({
86-
className,
87-
...props
86+
className,
87+
...props
8888
}: ArtifactActionsProps) => (
89-
<div className={cn("flex items-center gap-1", className)} {...props} />
89+
<div className={cn('flex items-center gap-1', className)} {...props} />
9090
);
9191

9292
export type ArtifactActionProps = ComponentProps<typeof Button> & {
93-
tooltip?: string;
94-
label?: string;
95-
icon?: LucideIcon;
93+
tooltip?: string;
94+
label?: string;
95+
icon?: LucideIcon;
9696
};
9797

9898
export const ArtifactAction = ({
99-
tooltip,
100-
label,
101-
icon: Icon,
102-
children,
103-
className,
104-
size = "sm",
105-
variant = "ghost",
106-
...props
99+
tooltip,
100+
label,
101+
icon: Icon,
102+
children,
103+
className,
104+
size = 'sm',
105+
variant = 'ghost',
106+
...props
107107
}: ArtifactActionProps) => {
108-
const button = (
109-
<Button
110-
className={cn(
111-
"size-8 p-0 text-muted-foreground hover:text-foreground",
112-
className
113-
)}
114-
size={size}
115-
type="button"
116-
variant={variant}
117-
{...props}
118-
>
119-
{Icon ? <Icon className="size-4" /> : children}
120-
<span className="sr-only">{label || tooltip}</span>
121-
</Button>
122-
);
123-
124-
if (tooltip) {
125-
return (
126-
<TooltipProvider>
127-
<Tooltip>
128-
<TooltipTrigger asChild>{button}</TooltipTrigger>
129-
<TooltipContent>
130-
<p>{tooltip}</p>
131-
</TooltipContent>
132-
</Tooltip>
133-
</TooltipProvider>
134-
);
135-
}
136-
137-
return button;
108+
const button = (
109+
<Button
110+
className={cn(
111+
'size-8 p-0 text-muted-foreground hover:text-foreground',
112+
className
113+
)}
114+
size={size}
115+
type="button"
116+
variant={variant}
117+
{...props}
118+
>
119+
{Icon ? <Icon className="size-4" /> : children}
120+
<span className="sr-only">{label || tooltip}</span>
121+
</Button>
122+
);
123+
124+
if (tooltip) {
125+
return (
126+
<TooltipProvider>
127+
<Tooltip>
128+
<TooltipTrigger asChild>{button}</TooltipTrigger>
129+
<TooltipContent>
130+
<p>{tooltip}</p>
131+
</TooltipContent>
132+
</Tooltip>
133+
</TooltipProvider>
134+
);
135+
}
136+
137+
return button;
138138
};
139139

140140
export type ArtifactContentProps = HTMLAttributes<HTMLDivElement>;
141141

142142
export const ArtifactContent = ({
143-
className,
144-
...props
143+
className,
144+
...props
145145
}: ArtifactContentProps) => (
146-
<div className={cn("flex-1 overflow-auto p-4", className)} {...props} />
146+
<div className={cn('flex-1 overflow-auto p-4', className)} {...props} />
147147
);

0 commit comments

Comments
 (0)