- Introduced `Field` and `Label` components for better form handling. - Refactored `Input` and `Textarea` components to use forward refs and improved styling. - Updated `PendingSubmitButton` to use the new `Button` component. - Enhanced `Skeleton` component for better layout handling. - Revamped `Toast` component to support live regions and improved accessibility. - Updated sidebar configuration to use typed icons. - Added phase 3 UI boundary checks to prevent usage of deprecated imports. - Implemented new authentication action handler for better cookie management. - Improved setup logic for freelancer accounts with repair functionality.
33 lines
686 B
TypeScript
33 lines
686 B
TypeScript
"use client";
|
|
|
|
import { useFormStatus } from "react-dom";
|
|
import { Button } from "@/components/ui/button";
|
|
import { Loader2 } from "lucide-react";
|
|
import React from "react";
|
|
|
|
interface SubmitButtonProps extends React.ComponentProps<typeof Button> {
|
|
pendingText?: string;
|
|
}
|
|
|
|
export function SubmitButton({
|
|
children,
|
|
pendingText,
|
|
type = "submit",
|
|
...props
|
|
}: SubmitButtonProps) {
|
|
const { pending } = useFormStatus();
|
|
|
|
return (
|
|
<Button type={type} disabled={pending} {...props}>
|
|
{pending ? (
|
|
<>
|
|
<Loader2 className="h-4 w-4 animate-spin" />
|
|
{pendingText || children}
|
|
</>
|
|
) : (
|
|
children
|
|
)}
|
|
</Button>
|
|
);
|
|
}
|