/* Copyright 2023, 2024 New Vector Ltd. SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial Please see LICENSE files in the repository root for full details. */ import classNames from "classnames"; import React, { type ComponentType, type PropsWithChildren, forwardRef, type ForwardedRef, type Ref, } from "react"; import styles from "./Button.module.css"; import { UnstyledButton, type UnstyledButtonPropsFor } from "./UnstyledButton"; import type { Size } from "../../utils/size"; interface ButtonComponent { // With the explicit `as` prop ( props: { as: C } & ButtonPropsFor, ): React.ReactElement; // Without the explicit `as` prop, defaulting to a