aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/atoms/layout/article/article.tsx
blob: 8611e20af70e967c982d76d822d85254aa9615a9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import {
  type ForwardRefRenderFunction,
  type HTMLAttributes,
  type ReactNode,
  forwardRef,
} from 'react';

export type ArticleProps = HTMLAttributes<HTMLElement> & {
  /**
   * The article contents.
   */
  children: ReactNode;
};

const ArticleWithRef: ForwardRefRenderFunction<HTMLElement, ArticleProps> = (
  props,
  ref
) => <article {...props} ref={ref} />;

/**
 * Article component.
 */
export const Article = forwardRef(ArticleWithRef);