You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
590 B
25 lines
590 B
import React from 'react';
|
|
|
|
type DefaulButtonProps = JSX.IntrinsicElements['button'];
|
|
|
|
export interface IconButtonProps extends DefaulButtonProps {
|
|
icon: React.ReactNode;
|
|
}
|
|
|
|
export const IconButton = ({
|
|
icon,
|
|
...props
|
|
}: IconButtonProps): JSX.Element => {
|
|
return (
|
|
<div className="my-auto text-gray-500 dark:text-gray-400">
|
|
<button
|
|
type="button"
|
|
className="p-2 rounded-md active:scale-95 hover:bg-gray-200 dark:hover:bg-gray-600"
|
|
{...props}
|
|
>
|
|
{icon}
|
|
<span className="sr-only">Refresh</span>
|
|
</button>
|
|
</div>
|
|
);
|
|
};
|
|
|