mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-18 07:23:51 +01:00
Add .oxfmtignore to skip generated bindings and wasm-pack output. Add npm format script, update DEVELOPMENT.md for Vite+ toolchain, and format all non-generated files with oxfmt. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
26 lines
609 B
TypeScript
26 lines
609 B
TypeScript
import { useState } from "react";
|
|
import type { ButtonProps } from "./Button";
|
|
import { Button } from "./Button";
|
|
|
|
export function ButtonInfiniteLoading({
|
|
onClick,
|
|
isLoading,
|
|
loadingChildren,
|
|
children,
|
|
...props
|
|
}: ButtonProps & { loadingChildren?: string }) {
|
|
const [localIsLoading, setLocalIsLoading] = useState<boolean>(false);
|
|
return (
|
|
<Button
|
|
isLoading={localIsLoading || isLoading}
|
|
onClick={(e) => {
|
|
setLocalIsLoading(true);
|
|
onClick?.(e);
|
|
}}
|
|
{...props}
|
|
>
|
|
{localIsLoading ? (loadingChildren ?? children) : children}
|
|
</Button>
|
|
);
|
|
}
|