aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/atoms/lists/description-list/description.tsx
blob: 9fa7ecd0224e183efb5f11afbc0ab61dbea5e03a (plain)
1
2
3
pre { line-height: 125%; }
td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
.highlight .hll { background-color: #ffffcc }
.highlight .c { color: #888888 } /* Comment */
.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */
.highlight .k { color: #008800; font-weight: bold } /* Keyword */
.highlight .ch { color: #888888 } /* Comment.Hashbang */
.highlight .cm { color: #888888 } /* 
import {
  forwardRef,
  type ForwardRefRenderFunction,
  type HTMLAttributes,
} from 'react';
import styles from './description-list.module.scss';

export type DescriptionProps = HTMLAttributes<HTMLElement>;

const DescriptionWithRef: ForwardRefRenderFunction<
  HTMLElement,
  DescriptionProps
> = ({ children, className = '', ...props }, ref) => {
  const descriptionClass = `${styles.description} ${className}`;

  return (
    <dd {...props} className={descriptionClass} ref={ref}>
      {children}
    </dd>
  );
};

/**
 * Description component.
 *
 * Use it inside a `DescriptionList` or a `Group` component.
 */
export const Description = forwardRef(DescriptionWithRef);