import React from 'react';
import { Box, Flex, BoxProps, color, Grid, space } from '@blockstack/ui';
import { border, onlyText, transition } from '@common/utils';
import { useTouchable } from '@common/hooks/use-touchable';
import { Caption, Text } from '@components/typography';
import Link from 'next/link';
import routes from '@common/routes';
import { Img } from '@components/mdx/image';
import { css } from '@styled-system/css';
import { getCapsizeStyles, getHeadingStyles } from '@components/mdx/typography';
const Image = ({
src,
isHovered,
size,
...rest
}: BoxProps & { src?: string; isHovered?: boolean }) => (
);
const Title = ({ children, ...props }: BoxProps) => (
{children}
);
const Description = ({ children, ...props }) => (
{children}
);
const FloatingLink = ({ href, ...props }: any) => (
);
const InlineCard = ({ page }) => {
const { hover, active, bind } = useTouchable({
behavior: 'link',
});
return (
{page.title || page.headings[0]}
{page.tags?.length ? (
{page.tags.map((tag, key) => (
{tag}
))}
) : null}
{page.description}
);
};
const GridCardImage: React.FC = React.memo(
({ isHovered, page, ...props }) => (
)
);
const GridCardDetails: React.FC = React.memo(
({ isHovered, page, ...props }) => (
<>
{page.title || page.headings[0]}
{page.description}
>
)
);
const GridCard: React.FC = React.memo(({ page, ...rest }) => {
const { hover, active, bind } = useTouchable({
behavior: 'link',
});
return (
);
});
export const PageReference: React.FC = React.memo(({ children }) => {
const content = onlyText(children).trim();
const [variant, _paths] = content.includes('\n') ? content.split('\n') : ['default', content];
const paths = _paths.includes(', ') ? _paths.split(', ') : [_paths];
if (!routes) return null;
const pages = paths.map(path => routes?.find(route => route.path === path)).filter(page => page);
return (
{pages.map(page =>
variant === 'inline' ? :
)}
);
});