Skip to content

Commit

Permalink
chore: add umami keys
Browse files Browse the repository at this point in the history
  • Loading branch information
IgboPharaoh committed Jul 16, 2024
1 parent 47c973b commit 7aa708c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/components/customResults/Result.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import DateIcon from "../svgs/DateIcon";
import ResultFavicon from "./ResultFavicon";
import { useTheme } from "@/context/Theme";
import { remapUrl } from "@/utils/documents";
import useSearchQuery from "@/hooks/useSearchQuery";

const htmlToReactParser = new (Parser as any)();

Expand All @@ -23,6 +24,7 @@ type ResultProps = {
const Result = ({ result }: ResultProps) => {
let dateString = null;
const { url, title, body, domain } = result;
const { searchQuery } = useSearchQuery();

const mappedUrl = remapUrl({ url, domain });

Expand Down Expand Up @@ -117,7 +119,7 @@ const Result = ({ result }: ResultProps) => {
target="_blank"
className="text-[12px] lg:text-base leading-none"
href={mappedUrl}
data-umami-event="URL Clicked"
data-umami-event={`${searchQuery}, ${mappedUrl}`}
data-umami-event-src={mappedUrl}
ref={linkRef}
>
Expand All @@ -131,6 +133,7 @@ const Result = ({ result }: ResultProps) => {
href={mappedUrl}
target="_blank"
className="pointer-events-auto md:group-hover/heading:text-custom-accent cursor-pointer hover:underline"
data-umami-event={`${searchQuery}, ${mappedUrl}`}
>
{htmlToReactParser.parse(sanitizeHtml(title))}
</a>
Expand Down

0 comments on commit 7aa708c

Please sign in to comment.