Skip to content

Commit acdef36

Browse files
committed
add type in copy button
1 parent 0b59b4c commit acdef36

File tree

3 files changed

+34
-3
lines changed

3 files changed

+34
-3
lines changed

components/copy-button.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@
33
import * as React from "react"
44
import { DropdownMenuTriggerProps } from "@radix-ui/react-dropdown-menu"
55
import { CheckIcon, ClipboardIcon } from "lucide-react"
6-
import { NpmCommands } from "types/unist"
6+
import { NpmCommands } from "@/type/unist"
77

88
import { Event, trackEvent } from "@/lib/events"
99
import { cn } from "@/lib/utils"
10-
import { Button, ButtonProps } from "@/registry/new-york/ui/button"
10+
import { Button, ButtonProps } from "@/components/ui/button"
1111
import {
1212
DropdownMenu,
1313
DropdownMenuContent,
1414
DropdownMenuItem,
1515
DropdownMenuTrigger,
16-
} from "@/registry/new-york/ui/dropdown-menu"
16+
} from "@/components/ui/dropdown-menu"
1717

1818
interface CopyButtonProps extends ButtonProps {
1919
value: string
File renamed without changes.

type/unist.ts

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import { Node } from "unist-builder"
2+
3+
export interface UnistNode extends Node {
4+
type: string
5+
name?: string
6+
tagName?: string
7+
value?: string
8+
properties?: {
9+
__rawString__?: string
10+
__className__?: string
11+
__event__?: string
12+
[key: string]: unknown
13+
} & NpmCommands
14+
attributes?: {
15+
name: string
16+
value: unknown
17+
type?: string
18+
}[]
19+
children?: UnistNode[]
20+
}
21+
22+
export interface UnistTree extends Node {
23+
children: UnistNode[]
24+
}
25+
26+
export interface NpmCommands {
27+
__npmCommand__?: string
28+
__yarnCommand__?: string
29+
__pnpmCommand__?: string
30+
__bunCommand__?: string
31+
}

0 commit comments

Comments
 (0)