📄 SearchResultComponent.razor
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
<div>
  <h2><a href="@result.Url">@result.Title</a></h2>
  @if (!string.IsNullOrEmpty(result.Summary))
  {
    <p>@result.Summary</p>
  }
</div>

@code {
  private SearchResult result;

  public SearchResultComponent(SearchResult result)
  {
    this.result = result;
  }
}