11import React , { FC } from 'react'
2- import { theme as antdtheme , Flex } from 'antd'
2+ import { theme as antdtheme , Flex , Typography } from 'antd'
33import { EarthIcon , getUppercase , hslFromString , Spacer } from '@prorobotech/openapi-k8s-toolkit'
44import { useSelector } from 'react-redux'
55import { RootState } from 'store/store'
@@ -16,11 +16,14 @@ export const EventRow: FC<TEventRowProps> = ({ e }) => {
1616 const theme = useSelector ( ( state : RootState ) => state . openapiTheme . theme )
1717
1818 const abbr = e . regarding ?. kind ? getUppercase ( e . regarding . kind ) : undefined
19- const bgColor = e . regarding ?. kind && abbr ? hslFromString ( abbr , theme ) : 'initial'
20- const bgColorNamespace = hslFromString ( 'NS ' , theme )
19+ const bgColor = e . regarding ?. kind && abbr ? hslFromString ( e . regarding ?. kind , theme ) : 'initial'
20+ const bgColorNamespace = hslFromString ( 'Namespace ' , theme )
2121
2222 return (
23- < Styled . Card $colorText = { token . colorText } >
23+ < Styled . Card
24+ $bigBorder = { e . type === 'Warning' }
25+ $mainColor = { e . type === 'Warning' ? token . colorWarningActive : token . colorText }
26+ >
2427 < Flex justify = "space-between" align = "center" >
2528 < Flex align = "center" gap = { 16 } >
2629 < Flex align = "center" gap = { 8 } >
@@ -44,10 +47,21 @@ export const EventRow: FC<TEventRowProps> = ({ e }) => {
4447 ) }
4548 </ Flex >
4649 < Spacer $space = { 16 } $samespace />
47- < Flex gap = { 8 } wrap >
50+ < Flex gap = { 8 } align = "center" wrap >
51+ < div >
52+ { e . deprecatedSource ?. component && (
53+ < Flex gap = { 8 } align = "center" wrap >
54+ < Flex gap = { 6 } align = "center" wrap >
55+ < Typography . Text type = "secondary" > Generated by</ Typography . Text >
56+ < Styled . Title > { e . deprecatedSource ?. component } </ Styled . Title >
57+ </ Flex >
58+ < div >
59+ < Typography . Text type = "secondary" > •</ Typography . Text >
60+ </ div >
61+ </ Flex >
62+ ) }
63+ </ div >
4864 < Styled . Title > { e . reason || e . action || 'Event' } </ Styled . Title >
49- < Styled . Title > •</ Styled . Title >
50- < Styled . Title > { e . type || 'Normal' } </ Styled . Title >
5165 </ Flex >
5266 < Spacer $space = { 16 } $samespace />
5367 { eventText ( e ) && < div > { eventText ( e ) } </ div > }
0 commit comments