1
- import React , { ReactNode } from "react"
2
- import { StaticImageData } from "next/image"
1
+ import type { ReactNode } from "react"
3
2
import {
4
3
Box ,
5
- BoxProps ,
4
+ type BoxProps ,
6
5
Flex ,
7
6
Heading ,
8
7
LinkBox ,
9
- LinkBoxProps ,
8
+ type LinkBoxProps ,
10
9
LinkOverlay ,
11
10
useColorModeValue ,
12
11
} from "@chakra-ui/react"
13
12
14
- import { Image } from "@/components/Image"
13
+ import { Image , type ImageProps } from "@/components/Image"
15
14
import { BaseLink } from "@/components/Link"
16
15
import Text from "@/components/OldText"
17
16
@@ -27,19 +26,19 @@ const linkFocusStyles: BoxProps = {
27
26
textDecoration : "none" ,
28
27
}
29
28
30
- export interface IProps extends Omit < LinkBoxProps , "title" > {
31
- children ?: React . ReactNode
29
+ export type ActionCardProps = Omit < LinkBoxProps , "title" > & {
30
+ children ?: ReactNode
32
31
to : string
33
32
alt ?: string
34
- image : StaticImageData
33
+ image : ImageProps [ "src" ]
35
34
title : ReactNode
36
35
description ?: ReactNode
37
36
className ?: string
38
37
isRight ?: boolean
39
38
isBottom ?: boolean
40
39
}
41
40
42
- const ActionCard : React . FC < IProps > = ( {
41
+ const ActionCard = ( {
43
42
to,
44
43
alt,
45
44
image,
@@ -49,8 +48,8 @@ const ActionCard: React.FC<IProps> = ({
49
48
className,
50
49
isRight,
51
50
isBottom = true ,
52
- ...rest
53
- } ) => {
51
+ ...props
52
+ } : ActionCardProps ) => {
54
53
const descriptionColor = useColorModeValue ( "blackAlpha.700" , "whiteAlpha.800" )
55
54
56
55
return (
@@ -64,7 +63,7 @@ const ActionCard: React.FC<IProps> = ({
64
63
_focus = { linkBoxFocusStyles }
65
64
className = { className }
66
65
m = { 4 }
67
- { ...rest }
66
+ { ...props }
68
67
>
69
68
< Flex
70
69
h = "260px"
@@ -77,12 +76,8 @@ const ActionCard: React.FC<IProps> = ({
77
76
>
78
77
< Image
79
78
src = { image }
80
- width = { 320 }
79
+ width = { 220 }
81
80
alt = { alt || "" }
82
- maxH = "257px"
83
- maxW = { { base : "311px" , sm : "372px" } }
84
- minW = "100px"
85
- minH = "100px"
86
81
style = { { objectFit : "cover" } }
87
82
/>
88
83
</ Flex >
0 commit comments