remirror/remirror

View on GitHub
packages/remirror__react-components/src/button-groups/text-alignment-button-group.tsx

Summary

Maintainability
A
0 mins
Test Coverage
import React, { FC, ReactNode } from 'react';

import {
  CenterAlignButton,
  JustifyAlignButton,
  LeftAlignButton,
  RightAlignButton,
} from '../buttons';
import { CommandButtonGroup } from './command-button-group';

export interface TextAlignmentButtonGroupProps {
  showAll?: boolean;
  children?: ReactNode | ReactNode[];
}

export const TextAlignmentButtonGroup: FC<TextAlignmentButtonGroupProps> = ({
  showAll = false,
  children,
}) => (
  <CommandButtonGroup>
    <LeftAlignButton />
    <CenterAlignButton />
    <RightAlignButton />
    {showAll && <JustifyAlignButton />}
    {children}
  </CommandButtonGroup>
);