Skip to content

Commit

Permalink
SCRUM-3986 update StrainBackground identifier
Browse files Browse the repository at this point in the history
  • Loading branch information
adamgibs committed Apr 29, 2024
1 parent 36c279d commit fbd317c
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/components/dataTable/StrainBackground.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
import ExternalLink from '../ExternalLink';
import { getIdentifier } from './utils';


function StrainBackground({strainBackground}) {
if(strainBackground?.curie && strainBackground?.name) {
const strainName = <span dangerouslySetInnerHTML={{__html: strainBackground.name}}/>;
const strain = strainBackground.curie.slice('SGD:'.length);
return <ExternalLink href={`https://www.yeastgenome.org/strain/${strain}`}>{strainName}</ExternalLink>;
}
return <></>;
const indentifier = getIdentifier(strainBackground);

if(!indentifier || !strainBackground?.name) return null;

const strainName = <span dangerouslySetInnerHTML={{__html: strainBackground.name}}/>;
const strain = indentifier.slice('SGD:'.length);

return <ExternalLink href={`https://www.yeastgenome.org/strain/${strain}`}>{strainName}</ExternalLink>;
}

export default StrainBackground;

0 comments on commit fbd317c

Please sign in to comment.