import React from 'react'
import { Search, Upload } from 'lucide-react'

interface AudioSearchBarProps {
  searchTerm: string
  onSearchChange: (value: string) => void
  onUpload: () => void
}

const AudioSearchBar: React.FC<AudioSearchBarProps> = ({
  searchTerm,
  onSearchChange,
  onUpload
}) => {
  return (
    <div className="flex items-center justify-between mb-6">
      <div className="relative flex-1 max-w-md">
        <Search className="absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400" size={20} />
        <input
          type="text"
          placeholder="搜索音频文件..."
          value={searchTerm}
          onChange={(e) => onSearchChange(e.target.value)}
          className="pl-10 pr-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent w-full"
        />
      </div>
      
      <button
        onClick={onUpload}
        className="ml-4 flex items-center px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors"
      >
        <Upload size={20} className="mr-2" />
        上传音频
      </button>
    </div>
  )
}

export default AudioSearchBar
