aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/organisms/comment/pending-comment/pending-comment.tsx
blob: 0d37ac2cb5838f20649e65fbb68348cce2cab9df (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import { type ForwardRefRenderFunction, forwardRef } from 'react';
import { useIntl } from 'react-intl';
import { Card, CardBody, type CardProps } from '../../../molecules';

export type PendingCommentProps = Omit<
  CardProps<undefined>,
  | 'children'
  | 'content'
  | 'cover'
  | 'id'
  | 'isCentered'
  | 'linkTo'
  | 'meta'
  | 'variant'
>;

const PendingCommentWithRef: ForwardRefRenderFunction<
  HTMLDivElement,
  PendingCommentProps
> = (props, ref) => {
  const intl = useIntl();

  return (
    <Card {...props} ref={ref} variant={2}>
      <CardBody>
        {intl.formatMessage({
          defaultMessage: 'This comment is awaiting moderation…',
          description: 'PendingComment: awaiting moderation text',
          id: '1d/xvG',
        })}
      </CardBody>
    </Card>
  );
};

export const PendingComment = forwardRef(PendingCommentWithRef);