@kiwicom/orbit-components
Version:
Orbit-components is a React component library which provides developers with the easiest possible way of building Kiwi.com’s products.
32 lines (30 loc) • 897 B
JavaScript
import * as React from "react";
import styled from "styled-components";
import Badge, { StyledBadge } from "../Badge";
import defaultTheme from "../defaultTheme";
import { TYPE_OPTIONS } from "../Badge/consts";
const StyledNotificationBadge = styled.div.withConfig({
displayName: "NotificationBadge__StyledNotificationBadge",
componentId: "zl2bxd-0"
})(["", "{width:", ";padding:0;}"], StyledBadge, ({
theme
}) => theme.orbit.widthBadgeCircled);
StyledNotificationBadge.defaultProps = {
theme: defaultTheme
};
const NotificationBadge = props => {
const {
type = TYPE_OPTIONS.NEUTRAL,
children,
icon,
ariaLabel,
dataTest
} = props;
return React.createElement(StyledNotificationBadge, null, React.createElement(Badge, {
type: type,
dataTest: dataTest,
icon: icon,
ariaLabel: ariaLabel
}, !icon && children));
};
export default NotificationBadge;