bb3b1a5db7
- Fix $effect orphan error: move $effect calls from store constructors to initEffects() methods called from component context - Fix icon rendering: create DynamicIcon component to render Lucide icons from name strings instead of displaying raw text - Add /boards/new route for board creation - Fix seed emails (admin@launcher.local / user@launcher.local) to pass Zod email validation
28 lines
666 B
Svelte
28 lines
666 B
Svelte
<script lang="ts">
|
|
import * as icons from 'lucide-svelte';
|
|
|
|
interface Props {
|
|
name: string | null;
|
|
size?: number;
|
|
class?: string;
|
|
}
|
|
|
|
let { name, size = 16, class: className = '' }: Props = $props();
|
|
|
|
// Convert kebab-case to PascalCase: "layout-dashboard" → "LayoutDashboard"
|
|
function toPascalCase(str: string): string {
|
|
return str
|
|
.split('-')
|
|
.map((part) => part.charAt(0).toUpperCase() + part.slice(1))
|
|
.join('');
|
|
}
|
|
|
|
const iconComponent = $derived(
|
|
name ? (icons as Record<string, unknown>)[toPascalCase(name)] ?? null : null
|
|
);
|
|
</script>
|
|
|
|
{#if iconComponent}
|
|
<svelte:component this={iconComponent} {size} class={className} />
|
|
{/if}
|