search page without from-to

This commit is contained in:
2025-05-23 14:49:12 +03:00
parent f3ca53d907
commit fa70a96c27
9 changed files with 142 additions and 24 deletions

View File

@@ -4,6 +4,7 @@ import React, { useEffect, useState } from 'react'
import Select from 'react-select'
import { SelectOption } from '@/app/types'
import axios from 'axios'
import Tooltip from './Tooltip'
interface LocationOption extends SelectOption {
value: string // добавляем поле value к базовому интерфейсу SelectOption
@@ -19,6 +20,7 @@ interface LocationSelectProps {
placeholder: string
countryId?: string
isCity?: boolean
tooltip?: string | React.ReactNode
}
const LocationSelect: React.FC<LocationSelectProps> = ({
@@ -26,6 +28,7 @@ const LocationSelect: React.FC<LocationSelectProps> = ({
value,
handleChange,
label,
tooltip,
placeholder,
countryId,
isCity = false,
@@ -61,9 +64,14 @@ const LocationSelect: React.FC<LocationSelectProps> = ({
return (
<div>
<label htmlFor={name} className="mb-1 block text-sm font-medium text-gray-700">
{label}
</label>
{label && (
<div className="my-2 flex items-center gap-2">
<label className="text-sm font-medium text-gray-500" htmlFor={name}>
{label}
</label>
{tooltip && <Tooltip content={tooltip} />}
</div>
)}
<Select<LocationOption>
inputId={name}
name={name}
@@ -90,7 +98,6 @@ const LocationSelect: React.FC<LocationSelectProps> = ({
control: base => ({
...base,
borderRadius: '0.75rem',
backgroundColor: '#F3F4F6',
border: '1px solid #E5E7EB',
padding: '2px',
'&:hover': {