mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2026-04-29 15:37:48 +00:00
39 lines
1020 B
TypeScript
39 lines
1020 B
TypeScript
import * as React from 'react'
|
|
import dynamicReact from '@markdoc/markdoc/dist/react'
|
|
import { Link } from '@redocly/theme/components/Link/Link'
|
|
|
|
export interface XRPLCardProps {
|
|
title: string
|
|
href: string
|
|
body?: string
|
|
image?: string
|
|
imageAlt?: string
|
|
external: boolean
|
|
}
|
|
|
|
export function XRPLCard(props: XRPLCardProps) {
|
|
return (
|
|
<Link className="card float-up-on-hover" to={props.href}>
|
|
<div className="card-body">
|
|
{props.image && (
|
|
<div className="card-icon-container">
|
|
<img src={props.image} alt={props.imageAlt} />
|
|
</div>
|
|
)}
|
|
<h4 className="card-title h5">{props.title}</h4>
|
|
{props.body && <p className="card-text">{props.body}</p>}
|
|
</div>
|
|
<div className="card-footer"> </div>
|
|
</Link>
|
|
)
|
|
}
|
|
|
|
export function CardGrid(props) {
|
|
const gridClass = `card-grid card-grid-${props.layout}`
|
|
return (
|
|
<div id={props.id} className={gridClass}>
|
|
{dynamicReact(props.children, React, {})}
|
|
</div>
|
|
)
|
|
}
|