Skip to content

Commit

Permalink
Fix divider
Browse files Browse the repository at this point in the history
  • Loading branch information
otenav committed Oct 14, 2024
1 parent dafdd12 commit 6ec1057
Showing 1 changed file with 9 additions and 22 deletions.
31 changes: 9 additions & 22 deletions src/app/(sok)/_components/searchResult/Divider.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import React, { ReactElement } from "react";
import { BodyShort, Box, Button, Heading, Hide, HStack } from "@navikt/ds-react";
import { BodyShort, Box, Heading } from "@navikt/ds-react";
import useQuery from "@/app/(sok)/_components/QueryProvider";
import joinStringWithSeperator from "@/app/_common/utils/joinStringWithSeperator";
import DetectiveIcon from "@/app/(sok)/_components/icons/DetectiveIcon";

interface DividerProps {
index: number;
Expand All @@ -13,27 +12,15 @@ export default function Divider({ index, indexOfLastWithScoreAboveThreshold }: D

if (indexOfLastWithScoreAboveThreshold !== 0 && indexOfLastWithScoreAboveThreshold === index) {
return (
<Box paddingInline="4" paddingBlock="2" borderRadius="small" background="surface-subtle" className="mt-12">
<HStack wrap={false} justify="space-between" align="center" gap="4">
<Box>
<Heading level="3" size="small" className="mb-05">
Viser bare mest relevante treff
</Heading>
<Box background="surface-alt-1-subtle" className="mt-16" paddingBlock="4" paddingInline="2">
<Heading level="3" size="medium" className="mb-05">
Mindre relevante treff
</Heading>

<BodyShort spacing>
13 flere annonser nevner <b>{joinStringWithSeperator(query.getAll("q"), "eller")}</b> i
annonseteksten
</BodyShort>
<Button variant="secondary-neutral" size="small">
Søk på nytt med alle treff
</Button>
</Box>
<Hide below="md">
<Box paddingInline="4">
<DetectiveIcon />
</Box>
</Hide>
</HStack>
<BodyShort>
Treffene er ikke like relevante, men nevner likevel{" "}
<b>{joinStringWithSeperator(query.getAll("q"), "eller")}</b> i annonseteksten
</BodyShort>
</Box>
);
}
Expand Down

0 comments on commit 6ec1057

Please sign in to comment.