Function
LinkButton
({
className,
variant,
size,
children,
loading,
loadingType = 'circle',
loadingSpeed = 'normal',
icon,
responsive,
...props
}: LinkComponentProps &
VariantProps<typeof buttonVariants> & {
loading?: boolean;
loadingType?: SpinnerProps['type'];
loadingSpeed?: SpinnerProps['speed'];
icon?: LucideIcon;
responsive?: boolean;
})
Source from the content-addressed store, hash-verified
| 153 | Button.displayName = 'Button'; |
| 154 | |
| 155 | const LinkButton = ({ |
| 156 | className, |
| 157 | variant, |
| 158 | size, |
| 159 | children, |
| 160 | loading, |
| 161 | loadingType = 'circle', |
| 162 | loadingSpeed = 'normal', |
| 163 | icon, |
| 164 | responsive, |
| 165 | ...props |
| 166 | }: LinkComponentProps & |
| 167 | VariantProps<typeof buttonVariants> & { |
| 168 | loading?: boolean; |
| 169 | loadingType?: SpinnerProps['type']; |
| 170 | loadingSpeed?: SpinnerProps['speed']; |
| 171 | icon?: LucideIcon; |
| 172 | responsive?: boolean; |
| 173 | }) => { |
| 174 | const Icon = loading ? null : (icon ?? null); |
| 175 | |
| 176 | // Determine spinner size based on button size |
| 177 | const spinnerSize = size === 'lg' ? 'md' : size === 'icon' ? 'sm' : 'sm'; |
| 178 | |
| 179 | return ( |
| 180 | <Link |
| 181 | className={cn(buttonVariants({ variant, size, className }))} |
| 182 | {...props} |
| 183 | > |
| 184 | {(linkProps) => ( |
| 185 | <> |
| 186 | {loading && ( |
| 187 | <Spinner |
| 188 | className={cn( |
| 189 | 'flex-shrink-0', |
| 190 | responsive && 'mr-0 sm:mr-2', |
| 191 | !responsive && 'mr-2' |
| 192 | )} |
| 193 | size={spinnerSize} |
| 194 | speed={loadingSpeed} |
| 195 | type={loadingType} |
| 196 | variant={ |
| 197 | variant === 'default' || variant === 'cta' ? 'white' : 'default' |
| 198 | } |
| 199 | /> |
| 200 | )} |
| 201 | {Icon && ( |
| 202 | <Icon |
| 203 | className={cn( |
| 204 | 'mr-2 h-4 w-4 flex-shrink-0', |
| 205 | responsive && 'mr-0 sm:mr-2' |
| 206 | )} |
| 207 | /> |
| 208 | )} |
| 209 | {responsive ? ( |
| 210 | <span className="hidden sm:block"> |
| 211 | {typeof children === 'function' ? children(linkProps) : children} |
| 212 | </span> |
Callers
nothing calls this directly
Tested by
no test coverage detected