<commit_before>import type { ReactElement } from "react";
import { AppBarAction } from "@react-md/app-bar";
import {
  FormatAlignLeftSVGIcon,
  FormatAlignRightSVGIcon,
} from "@react-md/material-icons";
import { MenuItem } from "@react-md/menu";
import { Tooltip, useTooltip } from "@react-md/tooltip";
import { useDir } from "@react-md/utils";

export interface ToggleRTLProps {
  as: "action" | "menuitem";
}

export default function ToggleRTL({ as }: ToggleRTLProps): ReactElement {
  const { dir, toggleDir } = useDir();
  const isRTL = dir === "rtl";
  let icon = <FormatAlignLeftSVGIcon />;
  if (isRTL) {
    icon = <FormatAlignRightSVGIcon />;
  }

  const { elementProps, tooltipProps } = useTooltip({
    baseId: "toggle-rtl",
    onClick: toggleDir,
  });

  if (as === "menuitem") {
    return (
      <MenuItem
        id="toggle-rtl"
        onClick={toggleDir}
        leftAddon={icon}
        secondaryText={`Current orientation: ${isRTL ? "RTL" : "LTR"}`}
      >
        Toggle RTL
      </MenuItem>
    );
  }

  return (
    <>
      <AppBarAction
        {...elementProps}
        last
        aria-label="Right to left layout"
        aria-pressed={isRTL}
      >
        {icon}
      </AppBarAction>
      <Tooltip {...tooltipProps}>TOggle right to left</Tooltip>
    </>
  );
}
<commit_msg>chore(website): Fix typo for RTL tooltip<commit_after>import type { ReactElement } from "react";
import { AppBarAction } from "@react-md/app-bar";
import {
  FormatAlignLeftSVGIcon,
  FormatAlignRightSVGIcon,
} from "@react-md/material-icons";
import { MenuItem } from "@react-md/menu";
import { Tooltip, useTooltip } from "@react-md/tooltip";
import { useDir } from "@react-md/utils";

export interface ToggleRTLProps {
  as: "action" | "menuitem";
}

export default function ToggleRTL({ as }: ToggleRTLProps): ReactElement {
  const { dir, toggleDir } = useDir();
  const isRTL = dir === "rtl";
  let icon = <FormatAlignLeftSVGIcon />;
  if (isRTL) {
    icon = <FormatAlignRightSVGIcon />;
  }

  const { elementProps, tooltipProps } = useTooltip({
    baseId: "toggle-rtl",
    onClick: toggleDir,
  });

  if (as === "menuitem") {
    return (
      <MenuItem
        id="toggle-rtl"
        onClick={toggleDir}
        leftAddon={icon}
        secondaryText={`Current orientation: ${isRTL ? "RTL" : "LTR"}`}
      >
        Toggle RTL
      </MenuItem>
    );
  }

  return (
    <>
      <AppBarAction
        {...elementProps}
        last
        aria-label="Right to left layout"
        aria-pressed={isRTL}
      >
        {icon}
      </AppBarAction>
      <Tooltip {...tooltipProps}>Toggle right to left</Tooltip>
    </>
  );
}

{'fraction_non_alphanumeric': 0.1470477623166604, 'fraction_numerical': 0.0, 'mean_word_length': 2.7464788732394365, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '1369480', 'n_tokens_mistral': 890, 'n_tokens_neox': 887, 'n_words': 195}