[refac] Replace <a> with Link and button for Quick Links
This commit is contained in:
@@ -1,14 +1,29 @@
|
||||
<script lang="ts">
|
||||
let { children, onclick = null } = $props();
|
||||
type ButtonSize = 'sm' | 'md' | 'lg';
|
||||
|
||||
let {
|
||||
children,
|
||||
onclick = null,
|
||||
disabled = false,
|
||||
size = 'md' as ButtonSize,
|
||||
class: className = ''
|
||||
} = $props();
|
||||
|
||||
const sizeClasses: Record<ButtonSize, string> = {
|
||||
sm: 'px-3 py-1.5',
|
||||
md: 'px-4 py-2',
|
||||
lg: 'px-2 py-2'
|
||||
};
|
||||
</script>
|
||||
|
||||
<button
|
||||
class="bg-ecsess-600 hover:bg-ecsess-500 active:bg-ecsess-700
|
||||
inline-block rounded-md border-none px-4
|
||||
py-2 text-white transition-all
|
||||
duration-200 ease-out
|
||||
hover:scale-105 hover:shadow-xl"
|
||||
{onclick}
|
||||
disabled={disabled}
|
||||
onclick={onclick}
|
||||
class="rounded-md border border-ecsess-200 bg-ecsess-500
|
||||
{sizeClasses[size]}
|
||||
text-sm font-semibold text-ecsess-50 transition-colors
|
||||
hover:bg-ecsess-600/50 hover:border-ecsess-300
|
||||
disabled:pointer-events-none disabled:opacity-50 {className}"
|
||||
>
|
||||
{@render children()}
|
||||
{@render children?.()}
|
||||
</button>
|
||||
|
||||
Reference in New Issue
Block a user