A self hosted solution for privately rating and reviewing different sorts of media
at master 590 B view raw
1'use client'; 2 3import React from 'react'; 4import { Button, ButtonProps } from './ui/button'; 5import { cn } from '@/lib/utils'; 6import { useFormStatus } from 'react-dom'; 7import { Loader, Loader2 } from 'lucide-react'; 8 9const SubmitButton = ({ 10 children, 11 isPending, 12 className, 13 ...props 14}: ButtonProps & { isPending: boolean }) => { 15 return ( 16 <Button 17 className={cn('w-full', className)} 18 disabled={isPending} 19 size="sm" 20 {...props} 21 > 22 {isPending && <Loader2 className="animate-spin" />} {children} 23 </Button> 24 ); 25}; 26 27export default SubmitButton;