|
|
|
@ -153,7 +153,47 @@ export function Button({ |
|
|
|
); |
|
|
|
}; |
|
|
|
|
|
|
|
const button = ( |
|
|
|
const content = isLoading ? ( |
|
|
|
<LoadingThreeDot /> |
|
|
|
) : ( |
|
|
|
<span className="flex w-full items-center justify-center gap-2"> |
|
|
|
{renderArrow("left")} |
|
|
|
<span className="flex min-w-0 flex-col items-center justify-center"> |
|
|
|
<span className="flex items-center justify-center gap-2 text-center group-16 font-semibold leading-none"> |
|
|
|
{children} |
|
|
|
</span> |
|
|
|
{description && !isOutlined ? ( |
|
|
|
<span |
|
|
|
id={countdownId} |
|
|
|
className="mt-1 text-center group-10 font-semibold leading-none text-white" |
|
|
|
> |
|
|
|
{description} |
|
|
|
</span> |
|
|
|
) : null} |
|
|
|
</span> |
|
|
|
{countdownLocked ? ( |
|
|
|
<span className="shrink-0"> |
|
|
|
<CountdownProgress value={remainingSeconds} progress={progress} /> |
|
|
|
</span> |
|
|
|
) : ( |
|
|
|
renderArrow("right") |
|
|
|
)} |
|
|
|
</span> |
|
|
|
); |
|
|
|
|
|
|
|
if (href) { |
|
|
|
return ( |
|
|
|
<Link |
|
|
|
href={localizePath(href, locale)} |
|
|
|
aria-disabled={isDisabled} |
|
|
|
className={`${baseClassName} ${isDisabled ? "pointer-events-none" : ""}`} |
|
|
|
> |
|
|
|
{content} |
|
|
|
</Link> |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
return ( |
|
|
|
<button |
|
|
|
{...props} |
|
|
|
type={type} |
|
|
|
@ -161,41 +201,9 @@ export function Button({ |
|
|
|
aria-describedby={description && !isOutlined ? countdownId : undefined} |
|
|
|
className={baseClassName} |
|
|
|
> |
|
|
|
{isLoading ? ( |
|
|
|
<LoadingThreeDot /> |
|
|
|
) : ( |
|
|
|
<span className="flex w-full items-center justify-center gap-2"> |
|
|
|
{renderArrow("left")} |
|
|
|
<span className="flex min-w-0 flex-col items-center justify-center"> |
|
|
|
<span className="flex items-center justify-center gap-2 text-center group-16 font-semibold leading-none"> |
|
|
|
{children} |
|
|
|
</span> |
|
|
|
{description && !isOutlined ? ( |
|
|
|
<span |
|
|
|
id={countdownId} |
|
|
|
className="mt-1 text-center group-10 font-semibold leading-none text-white" |
|
|
|
> |
|
|
|
{description} |
|
|
|
</span> |
|
|
|
) : null} |
|
|
|
</span> |
|
|
|
{countdownLocked ? ( |
|
|
|
<span className="shrink-0"> |
|
|
|
<CountdownProgress value={remainingSeconds} progress={progress} /> |
|
|
|
</span> |
|
|
|
) : ( |
|
|
|
renderArrow("right") |
|
|
|
)} |
|
|
|
</span> |
|
|
|
)} |
|
|
|
{content} |
|
|
|
</button> |
|
|
|
); |
|
|
|
|
|
|
|
return href ? ( |
|
|
|
<Link href={localizePath(href, locale)}>{button}</Link> |
|
|
|
) : ( |
|
|
|
button |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
type CountdownProgressProps = { |
|
|
|
|