Files
Musify/web-player/src/lib/components/ui/TrackTable.svelte
T
Admin dc1ba89a6d Add likes, follows and playlist visibility; redesign web-player UI
Backend:
- New Likes feature (toggle/get liked tracks) and endpoints
- User follow/unfollow, listening stats, public user profile
- Playlist visibility (public/private) support
- Various auth and DTO/response adjustments to support the above

Frontend (web-player):
- New design system pass: theme tokens/mode (light/dark), glass menu,
  tabs bar, player dock/extras/queue components, mix tiles, artist link
- New routes: Liked, public user profile (/u/[id]), likes API proxy
- Search refactor: shared SearchBox component used by TopBar and
  MobileHeader (search now reachable on mobile), live results as you
  type instead of requiring Enter, dropped the "Buscando…" quick-result
  preview
- Removed now-unused components (MobileNav, CoverBadge, MixBentoTile,
  PlayPauseOverlay, SuggestionsTable, userDirectory)
- Design handoff reference docs added under web-player/design_handoff_musify_player
  and web-player/docs/design-system-refactor-plan.md
2026-09-14 23:42:45 +02:00

78 lines
1.8 KiB
Svelte

<script lang="ts" module>
export const trackTableKey = Symbol('track-table');
export interface TrackTableContext {
readonly columns: string;
readonly columnsMobile: string;
}
export interface TrackMetaColumn {
label: string;
width: string;
}
</script>
<script lang="ts">
import { setContext } from 'svelte';
import type { Snippet } from 'svelte';
interface Props {
index?: boolean;
action?: boolean;
meta?: TrackMetaColumn[];
class?: string;
children: Snippet;
}
let { index = false, action = false, meta = [], class: klass = '', children }: Props = $props();
const columns = $derived(
[
index ? '32px' : '',
'minmax(180px,1fr)',
...meta.map((column) => column.width),
'64px',
action ? '36px' : ''
]
.filter((width) => width !== '')
.join(' ')
);
const columnsMobile = $derived(
[index ? '28px' : '', 'minmax(120px,1fr)', '52px', action ? '32px' : '']
.filter((width) => width !== '')
.join(' ')
);
setContext<TrackTableContext>(trackTableKey, {
get columns() {
return columns;
},
get columnsMobile() {
return columnsMobile;
}
});
</script>
<div class="overflow-x-auto {klass}">
<div
class="grid track-grid items-center gap-3 border-b border-white/5 pr-4 pb-3 pl-2 text-[10.5px] font-semibold tracking-[0.12em] text-muted uppercase sm:gap-8 sm:pr-6 sm:pl-3"
style="--mf-track-cols:{columns}; --mf-track-cols-mobile:{columnsMobile}"
>
{#if index}
<span class="text-center">#</span>
{/if}
<span>Título</span>
{#each meta as column (column.label)}
<span class="hidden text-center sm:block">{column.label}</span>
{/each}
<span class="hidden text-center sm:block">Duración</span>
{#if action}
<span></span>
{/if}
</div>
<div class="mt-1 flex flex-col gap-0.5">
{@render children()}
</div>
</div>