forked from equinor/flotilla
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskAnalysisDisplay.tsx
More file actions
32 lines (29 loc) · 1.22 KB
/
Copy pathTaskAnalysisDisplay.tsx
File metadata and controls
32 lines (29 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import { Button, Typography } from '@equinor/eds-core-react'
import { useLanguageContext } from 'components/Contexts/LanguageContext'
import styled from 'styled-components'
import { useInspectionId } from 'pages/InspectionReportPage/SetInspectionIdHook'
import { tokens } from '@equinor/eds-tokens'
import { InspectionData } from 'models/InspectionRecord'
const StyledButton = styled(Button)`
&:hover {
${({ color }) =>
color === 'danger'
? `border-color: ${tokens.colors.interactive.danger__hover.hex};`
: `border-color: ${tokens.colors.interactive.primary__hover.hex};`};
}
`
export const TaskAnalysisDisplay = ({ inspectionData }: { inspectionData: InspectionData }) => {
const { TranslateText } = useLanguageContext()
const { switchSelectedAnalysisId } = useInspectionId()
return (
<StyledButton
color={inspectionData.warning ? 'danger' : 'primary'}
variant="ghost"
onClick={() => switchSelectedAnalysisId(inspectionData.inspectionId)}
>
<Typography link color={inspectionData.warning ? 'danger' : 'primary'}>
{TranslateText('Result')}
</Typography>
</StyledButton>
)
}