'use client'

import { Search } from 'lucide-react'
import { useForm } from 'react-hook-form'
import { InputMui } from './mui/inputs'
import { Label } from './ui/label'
import {
  Select,
  SelectContent,
  SelectGroup,
  SelectItem,
  SelectTrigger,
  SelectValue,
} from './ui/select'

export default function SearchFilter() {
  const { register } = useForm()

  return (
    <div className="container grid md:grid-cols-2 gap-8 items-end mb-8">
      <div className="flex items-center max-w-[712px] flex-1">
        <InputMui
          label="O que você quer aprender hoje?"
          variant="standard"
          type="text"
          className="w-full #fafafa"
          name="learned-today"
          register={register}
        />
        <Search size={24} className="-ml-6" />
      </div>
      <div>
        <Label>Filtrados por</Label>
        <Select defaultValue="recent">
          <SelectTrigger className="flex items-center border-gray-900 text-gray-900 dark:border-gray-50 dark:text-gray-50 max-w-[712px] flex-1">
            <SelectValue />
          </SelectTrigger>
          <SelectContent>
            <SelectGroup>
              <SelectItem value="recent">Mais recentes</SelectItem>
              <SelectItem value="fast">Cursos rápidos</SelectItem>
              <SelectItem value="students">Estudantes</SelectItem>
              <SelectItem value="immediate">Início imediato</SelectItem>
            </SelectGroup>
          </SelectContent>
        </Select>
      </div>
    </div>
  )
}
