import * as React from 'react';
import { observer } from 'mobx-react';
import StandaloneMutationTable from './StandaloneMutationTable';
import {
IMutationMapperProps,
default as MutationMapper,
} from 'shared/components/mutationMapper/MutationMapper';
import { MutationTableDownloadDataFetcher } from 'shared/lib/MutationTableDownloadDataFetcher';
import MutationMapperDataStore from 'shared/components/mutationMapper/MutationMapperDataStore';
import { computed } from 'mobx';
import { ExtendedMutationTableColumnType } from 'shared/components/mutationTable/MutationTable';
import _ from 'lodash';
import { extractColumnNames } from 'shared/components/mutationMapper/MutationMapperUtils';
import ResultsViewMutationTable from 'pages/resultsView/mutation/ResultsViewMutationTable';
export interface IStandaloneMutationMapperProps extends IMutationMapperProps {
// add standalone view specific props here if needed
downloadDataFetcher?: MutationTableDownloadDataFetcher;
generateGenomeNexusHgvsgUrl: (hgvsg: string) => string;
}
@observer
export default class StandaloneMutationMapper extends MutationMapper<
IStandaloneMutationMapperProps
> {
constructor(props: IMutationMapperProps) {
super(props);
}
protected get mutationTableComponent(): JSX.Element | null {
return (
);
}
@computed get columns(): ExtendedMutationTableColumnType[] {
const namespaceColumnNames = extractColumnNames(
this.props.store.namespaceColumnConfig
);
return _.concat(
StandaloneMutationTable.defaultProps.columns,
namespaceColumnNames
);
}
protected get isMutationTableDataLoading() {
return this.props.store.activeTranscript.isPending;
}
protected get mutationTable(): JSX.Element | null {
return (
{!this.isMutationTableDataLoading &&
this.mutationTableComponent}
);
}
}