mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-25 19:01:14 +01:00
Some small changes
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import classnames from 'classnames';
|
||||
import type { KeyboardEvent, MouseEvent, ReactNode } from 'react';
|
||||
import type { HTMLAttributes } from 'react';
|
||||
import { forwardRef } from 'react';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { Icon } from './Icon';
|
||||
@@ -14,22 +14,13 @@ const colorStyles = {
|
||||
danger: 'bg-red-400 text-white hover:bg-red-500',
|
||||
};
|
||||
|
||||
export type ButtonProps = {
|
||||
export type ButtonProps = HTMLAttributes<HTMLElement> & {
|
||||
to?: string;
|
||||
color?: keyof typeof colorStyles;
|
||||
size?: 'sm' | 'md';
|
||||
justify?: 'start' | 'center';
|
||||
type?: 'button' | 'submit';
|
||||
onClick?: (event: MouseEvent<HTMLElement>) => void;
|
||||
onDoubleClick?: (event: MouseEvent<HTMLElement>) => void;
|
||||
contentEditable?: boolean;
|
||||
onKeyDown?: (event: KeyboardEvent<HTMLElement>) => void;
|
||||
forDropdown?: boolean;
|
||||
className?: string;
|
||||
children?: ReactNode;
|
||||
disabled?: boolean;
|
||||
title?: string;
|
||||
tabIndex?: number;
|
||||
};
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
import classnames from 'classnames';
|
||||
import type { ButtonProps } from './Button';
|
||||
import { Button } from './Button';
|
||||
|
||||
type Props = ButtonProps & {
|
||||
to: string;
|
||||
};
|
||||
|
||||
export function ButtonLink({ to, className, ...buttonProps }: Props) {
|
||||
return (
|
||||
<Button to={to} className={classnames(className, 'w-full')} tabIndex={-1} {...buttonProps} />
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user