File size: 1,011 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
38
39
40
41
42
import { HStack, Icon, Stack, Text } from "@chakra-ui/react"
import { LuArrowUpRight } from "react-icons/lu"
import { ResourceIcon } from "../resource-icon"

interface ResourceCardProps {
  type: string
  title: string
  url: string
  description?: string
}

export const ResourceCard = (props: ResourceCardProps) => {
  const { type, title, url, description, ...rest } = props
  return (
    <HStack
      borderWidth="1px"
      padding="4"
      borderRadius="md"
      gap="4"
      asChild
      {...rest}
    >
      <a href={url} target="_blank" rel="noopener noreferrer">
        <ResourceIcon type={type} />
        <Stack gap="1" flex="1">
          <Text fontWeight="medium" flex="1" color="fg" textStyle="sm">
            {title}
          </Text>
          {description && (
            <Text textStyle="sm" color="fg.muted/80">
              {description}
            </Text>
          )}
        </Stack>
        <Icon>
          <LuArrowUpRight />
        </Icon>
      </a>
    </HStack>
  )
}