fix: resolve runtime errors and missing routes
- 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
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
<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}
|
||||
Reference in New Issue
Block a user