-
Notifications
You must be signed in to change notification settings - Fork 202
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[GEN-1787]: descriptive titles for drawer "details card" (#1872)
- Loading branch information
1 parent
21b5af8
commit 480dcb2
Showing
7 changed files
with
128 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
...stinations/destination-modal/choose-destination-body/choose-destination-filters/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import React, { Dispatch, SetStateAction, useState } from 'react'; | ||
import styled from 'styled-components'; | ||
import { SignalUppercase } from '@/utils'; | ||
import type { DropdownOption } from '@/types'; | ||
import { Dropdown, Input, MonitoringCheckboxes } from '@/reuseable-components'; | ||
|
||
interface Props { | ||
selectedTag: DropdownOption | undefined; | ||
onTagSelect: (option: DropdownOption) => void; | ||
onSearch: (value: string) => void; | ||
selectedMonitors: SignalUppercase[]; | ||
setSelectedMonitors: Dispatch<SetStateAction<SignalUppercase[]>>; | ||
} | ||
|
||
const Container = styled.div` | ||
display: flex; | ||
align-items: center; | ||
gap: 12px; | ||
`; | ||
|
||
const WidthConstraint = styled.div` | ||
width: 160px; | ||
margin-right: 8px; | ||
`; | ||
|
||
const DROPDOWN_OPTIONS = [ | ||
{ value: 'All types', id: 'all' }, | ||
{ value: 'Managed', id: 'managed' }, | ||
{ value: 'Self-hosted', id: 'self hosted' }, | ||
]; | ||
|
||
export const ChooseDestinationFilters: React.FC<Props> = ({ selectedTag, onTagSelect, onSearch, selectedMonitors, setSelectedMonitors }) => { | ||
const [searchTerm, setSearchTerm] = useState(''); | ||
|
||
const handleSearchChange = (e: React.ChangeEvent<HTMLInputElement>) => { | ||
const value = e.target.value; | ||
setSearchTerm(value); | ||
onSearch(value); | ||
}; | ||
|
||
return ( | ||
<Container> | ||
<WidthConstraint> | ||
<Input placeholder='Search...' icon='/icons/common/search.svg' value={searchTerm} onChange={handleSearchChange} /> | ||
</WidthConstraint> | ||
<WidthConstraint> | ||
<Dropdown options={DROPDOWN_OPTIONS} value={selectedTag} onSelect={onTagSelect} onDeselect={() => {}} /> | ||
</WidthConstraint> | ||
<MonitoringCheckboxes title='' selectedSignals={selectedMonitors} setSelectedSignals={setSelectedMonitors} /> | ||
</Container> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters