Get rid of custom components folder
This commit is contained in:
parent
c493ac342b
commit
6d16f67280
38 changed files with 34 additions and 34 deletions
|
|
@ -1,38 +0,0 @@
|
|||
'use client';
|
||||
|
||||
import { useFormStatus } from 'react-dom';
|
||||
|
||||
import { LoaderIcon } from '@/components/custom/icons';
|
||||
|
||||
import { Button } from '../ui/button';
|
||||
|
||||
export function SubmitButton({
|
||||
children,
|
||||
isSuccessful,
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
isSuccessful: boolean;
|
||||
}) {
|
||||
const { pending } = useFormStatus();
|
||||
|
||||
return (
|
||||
<Button
|
||||
type={pending ? 'button' : 'submit'}
|
||||
aria-disabled={pending || isSuccessful}
|
||||
disabled={pending || isSuccessful}
|
||||
className="relative"
|
||||
>
|
||||
{children}
|
||||
|
||||
{(pending || isSuccessful) && (
|
||||
<span className="animate-spin absolute right-4">
|
||||
<LoaderIcon />
|
||||
</span>
|
||||
)}
|
||||
|
||||
<span aria-live="polite" className="sr-only" role="status">
|
||||
{pending || isSuccessful ? 'Loading' : 'Submit form'}
|
||||
</span>
|
||||
</Button>
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue