mirror of
https://github.com/PretendoNetwork/website.git
synced 2026-04-04 08:05:36 -05:00
24 lines
573 B
JavaScript
24 lines
573 B
JavaScript
import styles from './Caption.module.css';
|
|
import classNames from 'classnames';
|
|
|
|
|
|
/**
|
|
* A reusable component for captions.
|
|
*
|
|
* @param {boolean} center - Whether the text should be centered or not.
|
|
*
|
|
* @example
|
|
* <Caption>I, am, a caption! I, AM, A CAPTION! I AM- I AM A CAPTION!! I! AM A CAPTION, DR. HAN! I am a caption!</Caption>
|
|
*
|
|
*/
|
|
|
|
export default function Caption(ctx) {
|
|
const { children: caption, center, style, id } = ctx;
|
|
|
|
return (
|
|
<p className={classNames(styles.caption, { [styles.center]: center })} style={style} id={id}>
|
|
{caption}
|
|
</p>
|
|
);
|
|
}
|