1
1
import { StaticImageData } from "next/image"
2
2
import type { BaseHTMLAttributes , ElementType , ReactNode } from "react"
3
- import { useColorModeValue } from "@chakra-ui/react"
4
3
5
4
import { TwImage } from "@/components/Image"
6
5
import InlineLink from "@/components/ui/Link"
7
6
import { LinkBox , LinkOverlay } from "@/components/ui/link-box"
8
7
8
+ import { cn } from "@/lib/utils/cn"
9
+
9
10
import { Flex } from "./ui/flex"
10
11
export type ActionCardProps = Omit <
11
12
BaseHTMLAttributes < HTMLDivElement > ,
@@ -37,18 +38,20 @@ const ActionCard = ({
37
38
isBottom = true ,
38
39
...props
39
40
} : ActionCardProps ) => {
40
- const descriptionColor = useColorModeValue (
41
- "text-black opacity-65" ,
42
- "text-white opacity-80"
43
- )
44
-
45
41
return (
46
42
< LinkBox
47
- className = { `focus:bg-table-bg-hover m-4 flex flex-none shadow-table hover:scale-[1.02] hover:rounded hover:bg-background-highlight hover:shadow-table-box-hover hover:duration-100 focus:scale-[1.02] focus:rounded focus:shadow-table-box-hover focus:duration-100 ${ className } ` }
43
+ className = { cn (
44
+ "focus:bg-table-bg-hover m-4 flex flex-none shadow-table hover:scale-[1.02] hover:rounded hover:bg-background-highlight hover:shadow-table-box-hover hover:duration-100 focus:scale-[1.02] focus:rounded focus:shadow-table-box-hover focus:duration-100" ,
45
+ className
46
+ ) }
48
47
{ ...props }
49
48
>
50
49
< Flex
51
- className = { `action-card-image-wrapper flex h-[260px] flex-row bg-gradient-to-r from-accent-a/10 to-accent-c/10 ${ isBottom ? "items-end" : "items-center" } ${ isRight ? "justify-end" : "justify-center" } shadow-[inset_0px_-1px_0px_rgba(0,0,0,0.1)]` }
50
+ className = { cn (
51
+ "action-card-image-wrapper flex h-[260px] flex-row bg-gradient-to-r from-accent-a/10 to-accent-c/10 shadow-[inset_0px_-1px_0px_rgba(0,0,0,0.1)]" ,
52
+ isBottom ? "items-end" : "items-center" ,
53
+ isRight ? "justify-end" : "justify-center"
54
+ ) }
52
55
>
53
56
< TwImage
54
57
src = { image }
@@ -69,7 +72,9 @@ const ActionCard = ({
69
72
</ InlineLink >
70
73
</ LinkOverlay >
71
74
</ h3 >
72
- < p className = { `mb-0 ${ descriptionColor } ` } > { description } </ p >
75
+ < p className = { "mb-0 text-body opacity-65 dark:opacity-80" } >
76
+ { description }
77
+ </ p >
73
78
{ children && < div className = "mt-8" > { children } </ div > }
74
79
</ div >
75
80
</ LinkBox >
0 commit comments