Newer
Older
import { Link } from "@onegeo-suite/gatsby-theme-onegeo"
name?: string
description?: string
url?: string
full_base: {
main: "image-full ",
title: "",
description: "",
image: "h-52",
},
top_xs: {
main: "",
title: "",
description: "h-12",
image: "h-28",
},
top_xl: {
main: "",
title: "",
description: "h-32",
image: "h-72",
},
top_full: {
main: "rounded-none h-full w-full",
title: "",
description: "h-32",
image: "h-72",
},
left_bcase: {
main: "card-side h-72 w-full lg:hover:scale-105 lg:hover:-translate-y-0",
title: "",
description: "line-clamp-2",
image: "min-w-[450px] max-w-[450px]",
},
const CardContent = (props: ICard) => {
const lClass = layoutClass[layout + "_" + size] || layoutClass["top_base"]
// Options from Directus (config user)
class: {
main:
image
imageComponent
body
title
description
}
}
*/
const oClass = options.class || {}
const inlineSVG = options.inlineSVG
// <svg class='' ... />
// </figure>
// OR
// <figure>
// <img src={image.publicURL} />
{options.inlineSVG ? (
<div
className={twMerge(lClass.image, oClass.image)}
dangerouslySetInnerHTML={{
__html: options.inlineSVG,
}}
) : (
<div className={twMerge(lClass.image, oClass.image)}>
<Image
image={image}
className={twMerge(
"h-full w-full object-cover",
oClass.imageComponent
)}
/>
</div>
)}
<div className={twMerge("card-body", oClass.body)}>
{name}
</h2>
) : null}
{description ? (
<div
"overflow-hidden text-ellipsis text-justify ",
lClass.description,
oClass.description
)}
dangerouslySetInnerHTML={{ __html: description }}
/>
) : null}
{children}
</div>
const {
className = "",
anime = true,
layout = "top",
size = "base",
url,
} = props
const transition = anime
? "lg:transition duration-200 ease-in-out lg:hover:-translate-y-2 lg:hover:shadow-xl "
: ""
const lClass = layoutClass[layout + "_" + size] || layoutClass["top_base"]
"card card-compact bg-base-100 text-base-content shadow-lg",
>
<CardContent {...props} />
"card card-compact bg-base-100 text-base-content shadow-lg",
transition,
>
<CardContent {...props} />
</div>