-
Notifications
You must be signed in to change notification settings - Fork 67
/
TestHeader.tsx
39 lines (35 loc) 路 1.12 KB
/
TestHeader.tsx
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
33
34
35
36
37
38
39
import ResourceCardActions from 'components/ResourceCard/ResourceCardActions';
import {useDashboard} from 'providers/Dashboard/Dashboard.provider';
import * as S from './TestHeader.styled';
import VariableSetSelector from '../VariableSetSelector/VariableSetSelector';
interface IProps {
description: string;
id: string;
shouldEdit: boolean;
onEdit(): void;
onDelete(): void;
title: string;
runButton: React.ReactElement;
}
const TestHeader = ({description, id, shouldEdit, onEdit, onDelete, title, runButton}: IProps) => {
const {navigate} = useDashboard();
return (
<S.Container $isWhite>
<S.Section>
<a onClick={() => navigate(-1)} data-cy="test-header-back-button">
<S.BackIcon />
</a>
<div>
<S.Title data-cy="test-details-name">{title}</S.Title>
<S.Text>{description}</S.Text>
</div>
</S.Section>
<S.Section>
<VariableSetSelector />
{runButton}
<ResourceCardActions id={id} onDelete={onDelete} onEdit={onEdit} shouldEdit={shouldEdit} />
</S.Section>
</S.Container>
);
};
export default TestHeader;