-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Expand file tree
/
Copy pathCreateFileButton.tsx
More file actions
30 lines (28 loc) · 1.05 KB
/
CreateFileButton.tsx
File metadata and controls
30 lines (28 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import { DocumentPlusIcon } from "@heroicons/react/24/outline";
import { vscForeground } from "../..";
import { ToolTip } from "../../gui/Tooltip";
import HoverItem from "../../mainInput/InputToolbar/HoverItem";
interface CreateFileButtonProps {
onClick: () => void;
}
export function CreateFileButton({ onClick }: CreateFileButtonProps) {
return (
<ToolTip place="top" content="Create File with Code">
<HoverItem className="!p-0">
<button
data-testid="codeblock-toolbar-create"
aria-label="Create file with code"
className={`text-lightgray flex items-center border-none bg-transparent pl-0 text-xs text-[${vscForeground}] cursor-pointer outline-none hover:brightness-125`}
onClick={onClick}
>
<div className="flex items-center gap-1">
<DocumentPlusIcon className="h-3.5 w-3.5 shrink-0" />
<span className="line-clamp-1 select-none break-all">
Create file
</span>
</div>
</button>
</HoverItem>
</ToolTip>
);
}