From 0cfb9442c42e9f4e4340252b9e2a67d48e11a982 Mon Sep 17 00:00:00 2001 From: Sam Becker Date: Mon, 1 Jul 2024 11:16:10 -0500 Subject: [PATCH] Streamline --- .../primitives/PathLoaderButton.tsx | 29 +++---------------- 1 file changed, 4 insertions(+), 25 deletions(-) diff --git a/src/components/primitives/PathLoaderButton.tsx b/src/components/primitives/PathLoaderButton.tsx index ec212bb2..27a4efa8 100644 --- a/src/components/primitives/PathLoaderButton.tsx +++ b/src/components/primitives/PathLoaderButton.tsx @@ -1,39 +1,24 @@ 'use client'; import { useRouter } from 'next/navigation'; -import { ReactNode, useEffect, useState, useTransition } from 'react'; -import { SpinnerColor } from '../Spinner'; +import { ComponentProps, useEffect, useState, useTransition } from 'react'; import LoaderButton from '@/components/primitives/LoaderButton'; export default function PathLoaderButton({ path, - icon, - title, prefetch, loaderDelay = 100, shouldScroll = true, shouldReplace, - spinnerColor, - shouldPreventDefault, - styleAs, - hideTextOnMobile, - className, children, + ...props }: { path: string - icon?: ReactNode - title?: string prefetch?: boolean loaderDelay?: number shouldScroll?: boolean shouldReplace?: boolean - spinnerColor?: SpinnerColor - shouldPreventDefault?: boolean - styleAs?: 'button' | 'link' | 'link-without-hover' - hideTextOnMobile?: boolean - className?: string - children?: ReactNode -}) { +} & ComponentProps) { const router = useRouter(); const [isPending, startTransition] = useTransition(); @@ -59,9 +44,7 @@ export default function PathLoaderButton({ return ( { startTransition(() => { if (shouldReplace) { @@ -71,11 +54,7 @@ export default function PathLoaderButton({ } }); }} - shouldPreventDefault={shouldPreventDefault} isLoading={shouldShowLoader} - spinnerColor={spinnerColor} - styleAs={styleAs} - hideTextOnMobile={hideTextOnMobile} > {children}