feat: remove ChevronIcon in navbar; add icon prop to Button component
This commit is contained in:
@@ -44,6 +44,7 @@ type ButtonBaseProperties = {
|
||||
size?: VariantProps<typeof buttonVariants>['size']
|
||||
className?: string
|
||||
isLoading?: boolean
|
||||
icon?: ReactNode
|
||||
}
|
||||
|
||||
type PolymorphicReference<C extends ElementType> =
|
||||
@@ -64,6 +65,7 @@ export const Button = <C extends ElementType = 'button'>(
|
||||
size,
|
||||
className,
|
||||
isLoading = false,
|
||||
icon,
|
||||
...restProperties
|
||||
} = properties
|
||||
const Component = as || HeadlessButton
|
||||
@@ -74,7 +76,7 @@ export const Button = <C extends ElementType = 'button'>(
|
||||
className={classes}
|
||||
{...restProperties}
|
||||
>
|
||||
{isLoading && <ArrowPathIcon className="animate-spin" />}
|
||||
{isLoading ? <ArrowPathIcon className="size-5 animate-spin" /> : icon}
|
||||
{children}
|
||||
</Component>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user