| 1 | import { DocumentPlusIcon } from "@heroicons/react/24/outline"; |
| 2 | import { vscForeground } from "../.."; |
| 3 | import { ToolTip } from "../../gui/Tooltip"; |
| 4 | import HoverItem from "../../mainInput/InputToolbar/HoverItem"; |
| 5 | |
| 6 | interface CreateFileButtonProps { |
| 7 | onClick: () => void; |
| 8 | } |
| 9 | |
| 10 | export function CreateFileButton({ onClick }: CreateFileButtonProps) { |
| 11 | return ( |
| 12 | <ToolTip place="top" content="Create File with Code"> |
| 13 | <HoverItem className="!p-0"> |
| 14 | <button |
| 15 | data-testid="codeblock-toolbar-create" |
| 16 | className={`text-lightgray flex items-center border-none bg-transparent pl-0 text-xs text-[${vscForeground}] cursor-pointer outline-none hover:brightness-125`} |
| 17 | onClick={onClick} |
| 18 | > |
| 19 | <div className="flex items-center gap-1"> |
| 20 | <DocumentPlusIcon className="h-3.5 w-3.5 shrink-0" /> |
| 21 | <span className="line-clamp-1 select-none break-all"> |
| 22 | Create file |
| 23 | </span> |
| 24 | </div> |
| 25 | </button> |
| 26 | </HoverItem> |
| 27 | </ToolTip> |
| 28 | ); |
| 29 | } |