<!-- Marked string for highlighted search results -->
<script lang="ts">
  import type { StrMarked } from "$lib/util/types";

  export let text: string;
  export let marked: StrMarked | null | undefined = undefined;
</script>

{#if marked}
  <span>{marked[0]}</span><mark>{marked[1]}</mark><span>{marked[2]}</span>
{:else}
  {text}
{/if}
