move link outside of ternary

Signed-off-by: Jonathan Sundquist <jonathan.sundquist@factset.com>
This commit is contained in:
Jonathan Sundquist
2022-11-15 09:24:28 -06:00
parent a19cffbeed
commit 81e945d052
4 changed files with 41 additions and 44 deletions
@@ -72,19 +72,17 @@ export const DefaultResultListItemComponent = ({
<ListItemText
primaryTypographyProps={{ variant: 'h6' }}
primary={
highlight?.fields.title ? (
<Link noTrack to={result.location} onClick={handleClick}>
<Link noTrack to={result.location} onClick={handleClick}>
{highlight?.fields.title ? (
<HighlightedSearchResultText
text={highlight.fields.title}
preTag={highlight.preTag}
postTag={highlight.postTag}
text={highlight?.fields.title || ''}
preTag={highlight?.preTag || ''}
postTag={highlight?.postTag || ''}
/>
</Link>
) : (
<Link noTrack to={result.location} onClick={handleClick}>
{result.title}
</Link>
)
) : (
result.title
)}
</Link>
}
secondary={
<span