|
1 | | -import { Box, Typography, Container, Button } from '@mui/material' |
2 | | -import { useNavigate } from 'react-router-dom' |
| 1 | +import { Box, Typography, Container, TextField, InputAdornment, IconButton } from '@mui/material' |
| 2 | +import SearchIcon from '@mui/icons-material/Search' |
| 3 | +import CloseIcon from '@mui/icons-material/Close' |
3 | 4 |
|
4 | 5 | interface HeroSectionProps { |
5 | 6 | totalTerms: number |
6 | 7 | totalMeanings: number |
| 8 | + query: string |
| 9 | + onQueryChange: (query: string) => void |
7 | 10 | } |
8 | 11 |
|
9 | | -export function HeroSection({ totalTerms, totalMeanings }: HeroSectionProps) { |
10 | | - const navigate = useNavigate() |
11 | | - |
| 12 | +export function HeroSection({ totalTerms, totalMeanings, query, onQueryChange }: HeroSectionProps) { |
12 | 13 | return ( |
13 | 14 | <Box |
14 | 15 | sx={{ |
15 | | - background: 'linear-gradient(135deg, #ee4c2c 0%, #262626 100%)', |
| 16 | + background: 'linear-gradient(135deg, #ee4c2c 0%, #1a1a1a 100%)', |
16 | 17 | color: 'white', |
17 | | - py: 8, |
| 18 | + pt: { xs: 10, md: 11 }, |
| 19 | + pb: { xs: 4, md: 5 }, |
18 | 20 | mb: 4, |
19 | 21 | }} |
20 | 22 | > |
21 | 23 | <Container maxWidth="md"> |
22 | 24 | <Typography |
23 | | - variant="h2" |
| 25 | + variant="h3" |
24 | 26 | component="h1" |
25 | 27 | align="center" |
26 | 28 | gutterBottom |
27 | 29 | sx={{ fontWeight: 700 }} |
28 | 30 | > |
29 | 31 | AI/ML 용어집 |
30 | 32 | </Typography> |
31 | | - <Typography variant="h6" align="center" sx={{ mb: 3, opacity: 0.95 }}> |
32 | | - 인공지능과 머신러닝 용어의 한국어 번역을 표준화합니다 |
| 33 | + <Typography variant="h6" align="center" sx={{ mb: 2, opacity: 0.95 }}> |
| 34 | + AI/ML 한국어 번역 표준화 |
33 | 35 | </Typography> |
34 | | - <Box |
35 | | - sx={{ |
36 | | - display: 'flex', |
37 | | - justifyContent: 'center', |
38 | | - gap: { xs: 3, sm: 4 }, |
39 | | - flexDirection: { xs: 'column', sm: 'row' }, |
40 | | - alignItems: 'center', |
41 | | - }} |
42 | | - > |
43 | | - <Box sx={{ textAlign: 'center' }}> |
44 | | - <Typography variant="h4" sx={{ fontWeight: 700 }}> |
45 | | - {totalTerms} |
46 | | - </Typography> |
47 | | - <Typography variant="body2" sx={{ opacity: 0.9 }}> |
48 | | - 총 용어 수 |
49 | | - </Typography> |
50 | | - </Box> |
51 | | - <Box sx={{ textAlign: 'center' }}> |
52 | | - <Typography variant="h4" sx={{ fontWeight: 700 }}> |
53 | | - {totalMeanings} |
54 | | - </Typography> |
55 | | - <Typography variant="body2" sx={{ opacity: 0.9 }}> |
56 | | - 총 의미 수 |
57 | | - </Typography> |
58 | | - </Box> |
59 | | - </Box> |
60 | | - <Box sx={{ display: 'flex', justifyContent: 'center' }}> |
61 | | - <Button |
| 36 | + <Typography variant="body2" align="center" sx={{ mb: 3, opacity: 0.85 }}> |
| 37 | + {totalTerms} 용어 · {totalMeanings} 의미 |
| 38 | + </Typography> |
| 39 | + <Box sx={{ maxWidth: 600, mx: 'auto' }}> |
| 40 | + <TextField |
| 41 | + fullWidth |
62 | 42 | variant="outlined" |
63 | | - onClick={() => navigate('/about')} |
64 | | - sx={{ mt: 3, color: 'white', borderColor: 'rgba(255,255,255,0.5)', '&:hover': { borderColor: 'white', backgroundColor: 'rgba(255,255,255,0.1)' } }} |
65 | | - > |
66 | | - 프로젝트 소개 |
67 | | - </Button> |
| 43 | + placeholder="영어 용어 또는 한글 번역으로 검색하세요..." |
| 44 | + aria-label="용어 검색" |
| 45 | + value={query} |
| 46 | + onChange={(e) => onQueryChange(e.target.value)} |
| 47 | + slotProps={{ |
| 48 | + input: { |
| 49 | + startAdornment: ( |
| 50 | + <InputAdornment position="start"> |
| 51 | + <SearchIcon sx={{ color: 'text.secondary' }} /> |
| 52 | + </InputAdornment> |
| 53 | + ), |
| 54 | + endAdornment: query ? ( |
| 55 | + <InputAdornment position="end"> |
| 56 | + <IconButton |
| 57 | + size="small" |
| 58 | + onClick={() => onQueryChange('')} |
| 59 | + aria-label="검색어 지우기" |
| 60 | + > |
| 61 | + <CloseIcon fontSize="small" /> |
| 62 | + </IconButton> |
| 63 | + </InputAdornment> |
| 64 | + ) : null, |
| 65 | + }, |
| 66 | + }} |
| 67 | + sx={{ |
| 68 | + '& .MuiOutlinedInput-root': { |
| 69 | + backgroundColor: 'white', |
| 70 | + borderRadius: '28px', |
| 71 | + boxShadow: '0 4px 20px rgba(0,0,0,0.15)', |
| 72 | + '& fieldset': { border: 'none' }, |
| 73 | + }, |
| 74 | + '& .MuiOutlinedInput-input': { |
| 75 | + py: 1.5, |
| 76 | + }, |
| 77 | + }} |
| 78 | + /> |
68 | 79 | </Box> |
69 | 80 | </Container> |
70 | 81 | </Box> |
|
0 commit comments