continue-custom/extension/react-app/src/components/VSCodeFileLink.tsx
2023-06-03 00:21:52 -04:00

17 lines
369 B
TypeScript

import React from "react";
import { postVscMessage } from "../vscode";
function VSCodeFileLink(props: { path: string; text?: string }) {
return (
<a
href={`file://${props.path}`}
onClick={() => {
postVscMessage("openFile", { path: props.path });
}}
>
{props.text || props.path}
</a>
);
}
export default VSCodeFileLink;