UNPKG

@awsui/components-react

Version:

AWS UI is a collection of [React](https://reactjs.org/) components that help create intuitive, responsive, and accessible user experiences for web applications. It is developed by Amazon Web Services (AWS). This work is available under the terms of the [A

16 lines (15 loc) 909 B
import { __assign, __rest } from "tslib"; import clsx from 'clsx'; import React from 'react'; import { getBaseProps } from '../internal/base-component'; import styles from './styles.css.js'; import { Flash } from './flash'; import { useContainerBreakpoints } from '../internal/hooks/container-queries'; import { useTelemetry } from '../internal/hooks/use-telemetry'; export default function Flashbar(_a) { var items = _a.items, restProps = __rest(_a, ["items"]); useTelemetry('Flashbar'); var _b = useContainerBreakpoints(['xs']), breakpoint = _b[0], ref = _b[1]; var baseProps = getBaseProps(restProps); return (React.createElement("div", __assign({}, baseProps, { className: clsx(baseProps.className, styles.flashbar, styles["breakpoint-" + breakpoint]), ref: ref }), items && items.map(function (item, index) { return React.createElement(Flash, __assign({ key: index }, item)); }))); }