TelegramPWA/src/components/common/BadgeButton.tsx
2026-03-31 11:31:22 +02:00

42 lines
838 B
TypeScript

import { type TeactNode } from '../../lib/teact/teact';
import buildClassName from '../../util/buildClassName';
import styles from './BadgeButton.module.scss';
type OwnProps = {
children: TeactNode;
className?: string;
isPlain?: boolean;
inline?: boolean;
onClick?: (e: React.MouseEvent<HTMLDivElement>) => void;
onMouseDown?: (e: React.MouseEvent<HTMLDivElement>) => void;
};
const BadgeButton = ({
children,
className,
isPlain,
inline,
onClick,
onMouseDown,
}: OwnProps) => {
return (
<div
className={buildClassName(
styles.root,
isPlain && styles.plain,
onClick && styles.clickable,
inline && styles.inline,
className,
)}
onClick={onClick}
onMouseDown={onMouseDown}
>
{children}
</div>
);
};
export default BadgeButton;