1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-07-21 07:21:17 -04:00

<IFrame /> component

This commit is contained in:
2022-01-18 13:54:12 -05:00
parent eb172b83b0
commit caac9b905a
15 changed files with 141 additions and 78 deletions

View File

@@ -3,6 +3,8 @@ import innerText from "react-innertext";
import type { ReactNode } from "react";
import type { ImageProps as NextImageProps } from "next/image";
import styles from "./Figure.module.css";
type Props = Omit<NextImageProps, "alt"> & {
children: ReactNode; // caption (can be in markdown, yay!!!)
alt?: string; // becomes optional -- pulled from plaintext-ified caption if missing
@@ -10,9 +12,9 @@ type Props = Omit<NextImageProps, "alt"> & {
const Figure = ({ children, alt, ...imageProps }: Props) => {
return (
<figure>
<figure className={styles.figure}>
<Image alt={alt || innerText(children)} {...imageProps} />
<figcaption>{children}</figcaption>
<figcaption className={styles.caption}>{children}</figcaption>
</figure>
);
};