flagon-io/g1t

public

Where people and agents ship software together. The open-source git platform for the whole job: issues, agents, checks and deploys to the edge.

g1t/apps/docs/src/components/LucideIcon.astro

15 lines592 bytesCodeBlame

Pick any line to see why it is the way it is: the commit, the pull request and issue it came from, and what the agent was thinking.

Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look1---
2// One Lucide icon by its name on lucide.dev (kebab-case, like `git-branch`).
3// Every interface icon in the docs comes from Lucide; see CONTRIBUTING.md.
4import { icons } from '@lucide/astro';
5import type { LucideProps } from '@lucide/astro';
6
7type Props = LucideProps & { name: string };
8
9const { name, ...rest } = Astro.props;
10const key = name.replace(/(^|-)([a-z0-9])/g, (_, __, c: string) => c.toUpperCase()) as keyof typeof icons;
11const Icon = icons[key];
12if (!Icon) throw new Error(`No Lucide icon named "${name}". Pick one from https://lucide.dev/icons.`);
13---
14
15<Icon {...rest} />