aboutsummaryrefslogtreecommitdiffstats
path: root/client/js/app/src/app/components/card-link/card-link.jsx
blob: 197b18d219f27984661d14486c6ee0bb52cc9ea2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
import React from 'react';
import { Box } from '@mantine/core';

export function CardLink({
  sx,
  withBorder = true,
  borderStyle = 'solid',
  minHeight = '89px',
  minWidth = 'auto',
  ...props
}) {
  return (
    <Box
      sx={(theme) => ({
        minHeight,
        minWidth,
        display: 'grid',
        placeContent: 'center',
        justifyItems: 'center',
        rowGap: '8px',
        ...theme.fn.hover({
          cursor: 'pointer',
          background: theme.cr.getSubtleBackground(),
          border: withBorder
            ? `1px ${borderStyle} ${theme.cr.getUiElementBorderAndFocus()}`
            : 0,
        }),
        border: withBorder
          ? `1px ${borderStyle} ${theme.cr.getSubtleBorderAndSeparator()}`
          : 0,
        ...sx,
      })}
      {...props}
    />
  );
}