-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExpandedSearch.tsx
More file actions
54 lines (50 loc) · 1.44 KB
/
ExpandedSearch.tsx
File metadata and controls
54 lines (50 loc) · 1.44 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import { TagType } from '@/domains/tag/tpyes/tag.type';
import { RelatedTags } from '../../Lists/RelatedTags/RelatedTags';
import { TagList } from '../../Lists/TagList/TagList';
import * as styles from './ExpandedSearch.css';
import { KeyboardEvent } from 'react';
export const ExpandedSearch = ({
inputValue,
setInputValue,
handleKeyDown,
tagList,
relatedTags,
focusedIndex,
onClickRelatedTag,
onClickExpanded,
}: {
inputValue: string;
setInputValue: (value: string) => void;
handleKeyDown: (event: KeyboardEvent<HTMLInputElement>) => void;
tagList: string[];
relatedTags: TagType[];
focusedIndex: number;
onClickRelatedTag: (tag: TagType) => void;
onClickExpanded: () => void;
}) => {
return (
<>
<div className={styles.expandedWrapper}>
<input
className={styles.searchInput}
type="text"
placeholder="검색어를 입력하세요"
value={inputValue}
onChange={(e) => setInputValue(e.target.value)}
onKeyDown={handleKeyDown}
autoFocus
/>
<TagList tags={tagList} />
<RelatedTags relatedTags={relatedTags} focusedIndex={focusedIndex} onClickRelatedTag={onClickRelatedTag} />
</div>
<div
className={styles.OutExpandedWrapper}
onClick={onClickExpanded}
role="button"
tabIndex={0}
aria-label="검색 축소 화면 버튼"
onKeyDown={handleKeyDown}
/>
</>
);
};