toNotificationLevel
import { MyCustomSnackbar } from './MyCustomSnackbar'
import { useNotifications } from 'useink/notifications'
export const MyNotifications = ({ children }) => {
const { notifications } = useNotifications()
return (
<ul>
{notifications.map((n) => (
<li key={n.id}>
<MyCustomSnackbar
message={n.message}
type={
// e.g. `info` might have a blue background, and `error` a red one.
toNotificationLevel(n.type)
}
/>
</li>
))}
</ul>
)
}Notification type Conversion List
type Conversion ListReturn Type
Last updated