mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-05-10 12:44:47 -05:00
* Layout initial * Add FillRosterSection component * Move tournaments to feature folder * Refactor Button props * SubmitButton * Register action * Identifier -> Id * Invite link via nanoid * Team info submit * Enter tiebreaker map list UI * Invite members to tournament team initial * Show banner if joined a team not captain of * Add back teams page * Change team roster size color when good * Delete tournament team member
31 lines
668 B
TypeScript
31 lines
668 B
TypeScript
import { type FetcherWithComponents, useTransition } from "@remix-run/react";
|
|
import { Button, type ButtonProps } from "./Button";
|
|
|
|
interface SubmitButtonProps extends ButtonProps {
|
|
state?: FetcherWithComponents<any>["state"];
|
|
_action?: string;
|
|
}
|
|
|
|
export function SubmitButton({
|
|
children,
|
|
state,
|
|
_action,
|
|
...rest
|
|
}: SubmitButtonProps) {
|
|
const transition = useTransition();
|
|
|
|
const isSubmitting = state ? state !== "idle" : transition.state !== "idle";
|
|
|
|
return (
|
|
<Button
|
|
{...rest}
|
|
disabled={isSubmitting}
|
|
type="submit"
|
|
name={_action ? "_action" : undefined}
|
|
value={_action}
|
|
>
|
|
{children}
|
|
</Button>
|
|
);
|
|
}
|