feat(note_type_switcher): use arrows next to dropdowns

This commit is contained in:
Elian Doran
2025-12-15 16:47:53 +02:00
parent 3c41b7e5a9
commit 71d8588091

View File

@@ -14,7 +14,7 @@ interface SimpleBadgeProps {
} }
interface BadgeProps extends Pick<HTMLAttributes<HTMLDivElement>, "onClick" | "style"> { interface BadgeProps extends Pick<HTMLAttributes<HTMLDivElement>, "onClick" | "style"> {
text?: string; text?: ComponentChildren;
icon?: string; icon?: string;
className?: string; className?: string;
tooltip?: string; tooltip?: string;
@@ -51,14 +51,18 @@ export function Badge({ icon, className, text, tooltip, href, ...containerProps
); );
} }
export function BadgeWithDropdown({ children, tooltip, className, dropdownOptions, ...props }: BadgeProps & { export function BadgeWithDropdown({ text, children, tooltip, className, dropdownOptions, ...props }: BadgeProps & {
children: ComponentChildren, children: ComponentChildren,
dropdownOptions?: Partial<DropdownProps> dropdownOptions?: Partial<DropdownProps>
}) { }) {
return ( return (
<Dropdown <Dropdown
className={`dropdown-badge dropdown-${className}`} className={`dropdown-badge dropdown-${className}`}
text={<Badge className={className} {...props} />} text={<Badge
text={<>{text} <Icon icon="bx bx-chevron-down" /></>}
className={className}
{...props}
/>}
noDropdownListStyle noDropdownListStyle
noSelectButtonStyle noSelectButtonStyle
hideToggleArrow hideToggleArrow