Skip to content

Commit

Permalink
more to generalize highlighted result
Browse files Browse the repository at this point in the history
  • Loading branch information
ashleysmithTTD committed Dec 12, 2024
1 parent de3bdee commit 872711e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ type HighlightedResultProps<T> = Readonly<{
resultText: string;
}>;
export function HighlightedResult<T>({ result, resultText }: HighlightedResultProps<T>) {
//const text = `${result.item.name} (Site ID ${result.item.id})`;
if (!result.matches || result.matches.length < 1) return <span>{resultText}</span>;
const spans = getSpans([...result.matches[0].indices], resultText.length);
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,11 +192,8 @@ function AddParticipantDialog({
className='text-button'
onClick={() => onSiteClick(s.item)}
>
<HighlightedResult
result={s}
resultText={`${s.item.name} (Site ID ${s.item.id})`}
/>
(Site ID: {s.item.id})
<HighlightedResult result={s} resultText={s.item.name} /> (Site ID:{' '}
{s.item.id})
</button>
))}
</SearchBarResults>
Expand Down

0 comments on commit 872711e

Please sign in to comment.