Enhance upload functionality with genre selection and validation; refactor session cookie handling
This commit is contained in:
@@ -3,20 +3,21 @@
|
||||
|
||||
interface Props {
|
||||
selected?: boolean;
|
||||
disabled?: boolean;
|
||||
count?: number;
|
||||
href?: string;
|
||||
onclick?: () => void;
|
||||
children: Snippet;
|
||||
}
|
||||
|
||||
let { selected = false, count, href, onclick, children }: Props = $props();
|
||||
let { selected = false, disabled = false, count, href, onclick, children }: Props = $props();
|
||||
|
||||
const classes = $derived(
|
||||
href
|
||||
? 'rounded-full border border-line-strong px-3.5 py-2 text-xs text-fg-2 transition-colors hover:bg-hover hover:text-fg'
|
||||
: `flex items-center gap-2 rounded-full px-3.5 py-2 text-xs font-medium transition ${
|
||||
selected ? 'bg-cta-strong text-ink' : 'bg-btn text-fg-2 hover:bg-btn-hover hover:text-fg'
|
||||
}`
|
||||
} ${disabled ? 'cursor-not-allowed opacity-40' : ''}`
|
||||
);
|
||||
</script>
|
||||
|
||||
@@ -30,5 +31,5 @@
|
||||
{#if href}
|
||||
<a {href} class={classes}>{@render content()}</a>
|
||||
{:else}
|
||||
<button type="button" {onclick} class={classes}>{@render content()}</button>
|
||||
<button type="button" {onclick} {disabled} class={classes}>{@render content()}</button>
|
||||
{/if}
|
||||
|
||||
Reference in New Issue
Block a user