[feat] negodata: 견적 목록 작성자 컬럼·내 견적 필터 + 검색바 클리어(X) 버튼

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
minaChoiandClaude Opus 4.8 committed 2026-06-30 10:07:46 +09:00
1 parent 33ce82997a
commit 7b7a37ee98
15 files changed
+104 -14

No files matched your search

@@ -1,5 +1,5 @@
import type { ComponentProps, ReactNode } from 'react';
import { Search } from 'lucide-react';
import { Search, X } from 'lucide-react';
import { cn } from '@/lib/utils';
// 페이지 상단의 "검색/액션 바". card 외피 + 좌측(검색·필터) / 우측(액션 버튼) 레이아웃.
@@ -27,18 +27,30 @@ export function PageToolbar({
}
// 돋보기 아이콘 + 검색 input. 매 페이지 복붙하던 동일 마크업을 컴포넌트화.
export function SearchInput({ className, ...props }: ComponentProps<'input'>) {
// onClear 가 주어지고 입력값이 있으면 우측에 X 버튼 노출 → 클릭 시 비우고 재검색.
export function SearchInput({ className, onClear, ...props }: ComponentProps<'input'> & { onClear?: () => void }) {
const hasValue = props.value != null && String(props.value).length > 0;
return (
<div className="relative flex-1">
<Search className="absolute left-3 top-2.5 h-4 w-4 text-muted-foreground" />
<input
type="text"
className={cn(
'w-full pl-9 pr-3 py-2 text-xs bg-background border border-border rounded focus:outline-none focus:border-foreground/40 text-foreground transition-colors font-mono',
'w-full pl-9 pr-9 py-2 text-xs bg-background border border-border rounded focus:outline-none focus:border-foreground/40 text-foreground transition-colors font-mono',
className
)}
{...props}
/>
{hasValue && onClear && (
<button
type="button"
onClick={onClear}
aria-label="검색어 지우기"
className="absolute right-2.5 top-2.5 text-muted-foreground hover:text-foreground cursor-pointer transition-colors"
>
<X className="h-4 w-4" />
</button>
)}
</div>
);
}