fix(web): widen TrackMenuItem icon prop type to match Lucide signature

Previous fix narrowed `IconProp` to `ComponentType<SvelteComponent<{
size?: number, strokeWidth?: number, class?: string }>>` but Lucide
icons accept `size: string | number` (you can write size="16" or
size={16}), and the resulting structural mismatch surfaces 11 type
errors at every assignment site. Drop the prop-shape constraint
entirely — TrackMenuItem only ever passes numeric values to the icon.
This commit is contained in:
2026-05-02 23:34:11 -04:00
parent 5d69e9614f
commit d87d9e3255
+5 -4
View File
@@ -3,10 +3,11 @@
// Lucide-svelte ships class-based components (typeof ListPlus = ComponentType<...>),
// not runes-mode function components (Svelte 5's Component<...> type). Use
// ComponentType<SvelteComponent<...>> so any Lucide icon assigns cleanly.
type IconProp = ComponentType<
SvelteComponent<{ size?: number; strokeWidth?: number; class?: string }>
>;
// ComponentType<SvelteComponent> with no prop-shape constraint — Lucide
// accepts size/strokeWidth as `string | number` and a tighter constraint
// here trips structural assignment. We always pass numeric `size={14}` and
// `strokeWidth={1}` below so the runtime contract is consistent.
type IconProp = ComponentType<SvelteComponent>;
let {
icon,