summaryrefslogtreecommitdiff
path: root/extension/react-app/src/components/VSCodeFileLink.tsx
blob: 12ce5af82b4085e42191710a04bdfc653b91d01b (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 VS CodeFileLink(props: { path: string; text?: string }) {
  return (
    <a
      href={`file://${props.path}`}
      onClick={() => {
        postVscMessage("openFile", { path: props.path });
      }}
    >
      {props.text || props.path}
    </a>
  );
}

export default VS CodeFileLink;