<commit_before>import * as React from 'react';
import { Component } from 'react';
import cx from 'classnames';

import Button, { IButtonProps } from '../../../button';

const XML_NS = 'http://www.w3.org/2000/svg';

export interface IPaginationArrowButtonProps {
  direction: 'left' | 'right';
  double?: boolean;
  active?: boolean;
  bordered?: boolean;
  disabled?: boolean;
  onClick?: React.MouseEventHandler<HTMLElement>;
}

interface IPaginationDoubleArrowButtonState {
  showArrow: boolean;
  prevActive: boolean;
}

export class ArrowButton extends Component<
  IPaginationArrowButtonProps & Partial<IButtonProps>
> {
  static defaultProps = {
    double: false,
    active: false,
    bordered: true,
  };

  render() {
    const { direction, double, active, bordered, ...rest } = this.props;

    if (double) {
      return (
        <DoubleArrowButton
          direction={direction}
          active={active}
          bordered={bordered}
          {...rest}
        />
      );
    }

    let Arrow = (null as unknown) as React.FC;
    if (direction === 'left') {
      Arrow = LeftArrow;
    } else if (direction === 'right') {
      Arrow = RightArrow;
    }

    return (
      <Button
        {...rest}
        className={cx('zent-pagination-arrow-button', {
          'zent-pagination-page-button--no-border': !bordered,
        })}
      >
        <Arrow />
      </Button>
    );
  }
}

class DoubleArrowButton extends Component<
  IPaginationArrowButtonProps & Partial<IButtonProps>,
  IPaginationDoubleArrowButtonState
> {
  static defaultProps = {
    double: false,
    active: false,
    bordered: true,
  };

  state = {
    showArrow: false,
    prevActive: false,
  };

  render() {
    const { direction, active, bordered, ...rest } = this.props;
    const { showArrow } = this.state;
    let Arrow = (null as unknown) as React.FC;
    if (direction === 'left') {
      Arrow = LeftDoubleArrow;
    } else if (direction === 'right') {
      Arrow = RightDoubleArrow;
    }

    const isActive = showArrow;<commit_msg>fix: 修复分页组件 double 属性的 warning (#1109)<commit_after>import * as React from 'react';
import { Component } from 'react';
import cx from 'classnames';

import Button, { IButtonProps } from '../../../button';

const XML_NS = 'http://www.w3.org/2000/svg';

export interface IPaginationArrowButtonProps {
  direction: 'left' | 'right';
  double?: boolean;
  active?: boolean;
  bordered?: boolean;
  disabled?: boolean;
  onClick?: React.MouseEventHandler<HTMLElement>;
}

interface IPaginationDoubleArrowButtonState {
  showArrow: boolean;
  prevActive: boolean;
}

export class ArrowButton extends Component<
  IPaginationArrowButtonProps & Partial<IButtonProps>
> {
  static defaultProps = {
    double: false,
    active: false,
    bordered: true,
  };

  render() {
    const { direction, double, active, bordered, ...rest } = this.props;

    if (double) {
      return (
        <DoubleArrowButton
          direction={direction}
          active={active}
          bordered={bordered}
          {...rest}
        />
      );
    }

    let Arrow = (null as unknown) as React.FC;
    if (direction === 'left') {
      Arrow = LeftArrow;
    } else if (direction === 'right') {
      Arrow = RightArrow;
    }

    return (
      <Button
        {...rest}
        className={cx('zent-pagination-arrow-button', {
          'zent-pagination-page-button--no-border': !bordered,
        })}
      >
        <Arrow />
      </Button>
    );
  }
}

class DoubleArrowButton extends Component<
  IPaginationArrowButtonProps & Partial<IButtonProps>,
  IPaginationDoubleArrowButtonState
> {
  static defaultProps = {
    double: false,
    active: false,
    bordered: true,
  };

  state = {
    showArrow: false,
    prevActive: false,
  };

  render() {
    const { direction, active, bordered, double: _, ...rest } = this.props;
    const { showArrow } = this.state;
    let Arrow = (null as unknown) as React.FC;
    if (direction === 'left') {
      Arrow = LeftDoubleArrow;
    } else if (direction === 'right') {
      Arrow = RightDoubleArrow;
    }

    const isActive = showArrow;
{'fraction_non_alphanumeric': 0.13275193798449614, 'fraction_numerical': 0.003391472868217054, 'mean_word_length': 2.6282952548330405, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '137003', 'n_tokens_mistral': 1277, 'n_tokens_neox': 1287, 'n_words': 307}