feat: add avatar/bio/links/names/pronouns to user page

This commit is contained in:
sam 2024-09-24 20:56:10 +02:00
parent 412d720abc
commit 862a64840e
Signed by: sam
GPG key ID: B4EF20DDE721CAA1
16 changed files with 650 additions and 90 deletions

View file

@ -0,0 +1,16 @@
import * as icons from "react-bootstrap-icons";
import { IconProps as BaseIconProps } from "react-bootstrap-icons";
import { pascalCase } from "change-case";
const startsWithNumberRegex = /^\d/;
export default function Icon({ iconName, ...props }: BaseIconProps & { iconName: string }) {
let icon = pascalCase(iconName);
if (startsWithNumberRegex.test(icon)) {
icon = `Icon${icon}`;
}
// eslint-disable-next-line import/namespace
const BootstrapIcon = icons[icon as keyof typeof icons];
return <BootstrapIcon {...props} />;
}