Merge branch 'main' into feature-dashboard

This commit is contained in:
skkim committed 2026-03-25 16:52:13 +09:00
commit eceea6a5a4
18 files changed
+679 -721

No files matched your search

+23 -2
View File
@@ -124,6 +124,17 @@ const UrlInputContent: React.FC<UrlInputContentProps> = ({ onAnalyze, onAutocomp
}
};
// 붙여넣기 시 URL만 추출
const handlePaste = (e: React.ClipboardEvent<HTMLInputElement>) => {
if (searchType !== 'url') return;
const pasted = e.clipboardData.getData('text');
const urlMatch = pasted.match(/https?:\/\/[^\s]+/);
if (urlMatch) {
e.preventDefault();
setInputValue(urlMatch[0]);
}
};
// 폼 제출 처리
const handleSubmit = (e: React.FormEvent) => {
e.preventDefault();
@@ -196,10 +207,19 @@ const UrlInputContent: React.FC<UrlInputContentProps> = ({ onAnalyze, onAutocomp
{/* 입력 필드 */}
<div className="url-input-field-container" ref={autocompleteRef}>
<input
type={searchType === 'url' ? 'url' : 'text'}
type="text"
value={inputValue}
onChange={(e) => {
const value = e.target.value;
let value = e.target.value;
// URL 모드일 때 URL만 추출 (예: "[네이버 지도] https://...")
if (searchType === 'url') {
const urlMatch = value.match(/https?:\/\/\S+/);
if (urlMatch && urlMatch[0] !== value) {
value = urlMatch[0];
}
}
setInputValue(value);
// 업체명 검색일 때 자동완성 검색 (디바운스)
@@ -212,6 +232,7 @@ const UrlInputContent: React.FC<UrlInputContentProps> = ({ onAnalyze, onAutocomp
}, 300);
}
}}
onPaste={handlePaste}
onFocus={() => {
if (searchType === 'name' && autocompleteResults.length > 0) {
setShowAutocomplete(true);