chore(react/ribbon): add basic note types & badges

This commit is contained in:
Elian Doran
2025-08-21 20:16:06 +03:00
parent 4e9deab605
commit e2e9721d5f
6 changed files with 76 additions and 41 deletions

View File

@@ -63,15 +63,21 @@ export default function FormList({ children, onSelect, style, fullHeight }: Form
);
}
export interface FormListBadge {
className?: string;
text: string;
}
interface FormListItemOpts {
children: ComponentChildren;
icon?: string;
value?: string;
title?: string;
active?: boolean;
badges?: FormListBadge[];
}
export function FormListItem({ children, icon, value, title, active }: FormListItemOpts) {
export function FormListItem({ children, icon, value, title, active, badges }: FormListItemOpts) {
return (
<a
class={`dropdown-item ${active ? "active" : ""}`}
@@ -80,6 +86,9 @@ export function FormListItem({ children, icon, value, title, active }: FormListI
>
<Icon icon={icon} />&nbsp;
{children}
{badges && badges.map(({ className, text }) => (
<span className={`badge ${className ?? ""}`}>{text}</span>
))}
</a>
);
}