aboutsummaryrefslogtreecommitdiffstats
path: root/packages/website/ts/pages/documentation/source_link.tsx
blob: 31f80aba30f92237f6d26ec77597af53189f1ec1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import * as _ from 'lodash';
import * as React from 'react';
import { Source } from 'ts/types';
import { colors } from 'ts/utils/colors';

interface SourceLinkProps {
    source: Source;
    sourceUrl: string;
    version: string;
}

export function SourceLink(props: SourceLinkProps) {
    const src = props.source;
    const sourceCodeUrl = `${props.sourceUrl}/${src.fileName}#L${src.line}`;
    return (
        <div className="pt2" style={{ fontSize: 14 }}>
            <a href={sourceCodeUrl} target="_blank" className="underline" style={{ color: colors.grey }}>
                Source
            </a>
        </div>
    );
}