2025-11-23 18:43:55 +01:00
|
|
|
'use client';
|
|
|
|
|
|
|
|
|
|
import { Search, X } from 'lucide-react';
|
|
|
|
|
import { Input } from '@/components/ui/input';
|
|
|
|
|
import { Button } from '@/components/ui/button';
|
|
|
|
|
|
|
|
|
|
interface LogSearchProps {
|
|
|
|
|
value: string;
|
|
|
|
|
onChange: (value: string) => void;
|
|
|
|
|
placeholder?: string;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function LogSearch({ value, onChange, placeholder = 'Search logs...' }: LogSearchProps) {
|
|
|
|
|
return (
|
2025-11-23 21:52:35 +01:00
|
|
|
<div className="relative w-full sm:flex-1 sm:max-w-md">
|
2025-11-23 18:43:55 +01:00
|
|
|
<Search className="absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground" />
|
|
|
|
|
<Input
|
|
|
|
|
type="text"
|
|
|
|
|
placeholder={placeholder}
|
|
|
|
|
value={value}
|
|
|
|
|
onChange={(e) => onChange(e.target.value)}
|
|
|
|
|
className="pl-9 pr-9"
|
|
|
|
|
/>
|
|
|
|
|
{value && (
|
|
|
|
|
<Button
|
|
|
|
|
variant="ghost"
|
|
|
|
|
size="sm"
|
|
|
|
|
onClick={() => onChange('')}
|
|
|
|
|
className="absolute right-1 top-1/2 -translate-y-1/2 h-7 w-7 p-0"
|
|
|
|
|
>
|
|
|
|
|
<X className="h-4 w-4" />
|
|
|
|
|
</Button>
|
|
|
|
|
)}
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|