mirror of
https://github.com/tomru/pfadi-bussle.git
synced 2026-03-02 22:17:11 +01:00
fix: add proper types to Button component
Resolve type errors caused by stricter React typing after dependency update. Co-authored-by: Thomas Ruoff <111471+tomru@users.noreply.github.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
const Button = ({ children, loading = false, ...rest }) => {
|
const Button = ({ children, loading = false, ...rest }: React.ButtonHTMLAttributes<HTMLButtonElement> & { loading?: boolean }) => {
|
||||||
return (<button className="btn btn-blue" {...rest}>
|
return (<button className="btn btn-blue" {...rest}>
|
||||||
{loading &&
|
{loading &&
|
||||||
<svg className="inline animate-spin -ml-1 mr-3 h-4 w-4 text-white" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
|
<svg className="inline animate-spin -ml-1 mr-3 h-4 w-4 text-white" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
|
||||||
@@ -10,4 +10,4 @@ const Button = ({ children, loading = false, ...rest }) => {
|
|||||||
</button>);
|
</button>);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default Button;
|
export default Button;
|
||||||
|
|||||||
Reference in New Issue
Block a user