summaryrefslogtreecommitdiff
path: root/extension/react-app/src/components/VSCodeFileLink.tsx
blob: 6219654d90f7a6e747469c01d38535f29b05dd83 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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;