Skip to content

Commit a1dd615

Browse files
committed
style(code-copy): use props.class syntax
1 parent 0b7b813 commit a1dd615

File tree

1 file changed

+26
-28
lines changed

1 file changed

+26
-28
lines changed

apps/website/src/components/code-copy/code-copy.tsx

Lines changed: 26 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -7,36 +7,34 @@ export type CodeCopyProps = PropsOf<typeof Button> & {
77
code?: string;
88
};
99

10-
export const CodeCopy = component$<CodeCopyProps>(
11-
({ code = '', class: outsideClass, ...props }) => {
12-
const copied = useSignal(false);
10+
export const CodeCopy = component$<CodeCopyProps>(({ code = '', ...props }) => {
11+
const copied = useSignal(false);
1312

14-
return (
15-
<Button
16-
{...props}
17-
look="ghost"
18-
title={copied.value ? 'Copied to Clipboard' : 'Copy to Clipboard'}
19-
class={cn(outsideClass)}
20-
onClick$={async () => {
21-
await copy(code);
22-
copied.value = true;
13+
return (
14+
<Button
15+
{...props}
16+
look="ghost"
17+
title={copied.value ? 'Copied to Clipboard' : 'Copy to Clipboard'}
18+
class={cn(props.class)}
19+
onClick$={async () => {
20+
await copy(code);
21+
copied.value = true;
2322

24-
setTimeout(() => {
25-
copied.value = false;
26-
}, 4000);
27-
}}
28-
>
29-
{!copied.value ? (
30-
<CopyIcon />
31-
) : (
32-
<div class="flex gap-1">
33-
<ClipboardCheck />
34-
</div>
35-
)}
36-
</Button>
37-
);
38-
},
39-
);
23+
setTimeout(() => {
24+
copied.value = false;
25+
}, 4000);
26+
}}
27+
>
28+
{!copied.value ? (
29+
<CopyIcon />
30+
) : (
31+
<div class="flex gap-1">
32+
<ClipboardCheck />
33+
</div>
34+
)}
35+
</Button>
36+
);
37+
});
4038

4139
export function CopyIcon(props: PropsOf<'svg'> & { color?: string }, key: string) {
4240
return (

0 commit comments

Comments
 (0)