All Downloads are FREE. Search and download functionalities are using the official Maven repository.

components.snippets.Alerts.utils.jsx Maven / Gradle / Ivy

The newest version!
import React from 'react'
import PropTypes from 'prop-types'
import classNames from 'classnames'

export const TextSegment = ({ text, className }) => {
    if (!text) {
        return null
    }

    return (
        
{text}
) } TextSegment.propTypes = { text: PropTypes.string, className: PropTypes.string, } export const TimeStampSegment = ({ timestamp, text }) => { if (!timestamp) { return null } return (
{timestamp}
) } TimeStampSegment.propTypes = { timestamp: PropTypes.string, text: PropTypes.string, } export const CloseButtonSegment = ({ closeButton, onClick, text, timestamp, extended }) => { if (!closeButton) { return null } return (
) } CloseButtonSegment.propTypes = { closeButton: PropTypes.bool, onClick: PropTypes.func, text: PropTypes.string, timestamp: PropTypes.string, extended: PropTypes.bool, } export const StacktraceSegment = ({ stacktrace, onClick, stacktraceVisible, t }) => { if (!stacktrace) { return null } return (
{stacktraceVisible ? t('hide') : t('details')}
{stacktrace}
) } StacktraceSegment.propTypes = { stacktrace: PropTypes.string, onClick: PropTypes.func, stacktraceVisible: PropTypes.bool, t: PropTypes.func, }