create ui components

This commit is contained in:
2025-05-13 17:49:51 +03:00
parent 837c0f1fb6
commit e766284333
13 changed files with 202 additions and 44 deletions

View File

@@ -0,0 +1,45 @@
'use client'
import React, { useState } from 'react'
import TextInput from './ui/TextInput'
import Button from './ui/Button'
export default function AddressSelector() {
const [fromAddress, setFromAddress] = useState('')
const [toAddress, setToAddress] = useState('')
return (
<div className="bg-white rounded-xl shadow-lg p-6 w-full my-4">
<div className="flex flex-col sm:flex-row items-end gap-3">
<div className="flex-[3] min-w-0 px-1">
<TextInput
placeholder="Минск, Беларусь"
tooltip="Укажите пункт (Город/Страна), откуда необходимо забрать посылку."
label="Забрать посылку из"
value={fromAddress}
handleChange={(e) => setFromAddress(e.target.value)}
name="fromAddress"
/>
</div>
<div className="flex-[3] min-w-0 px-1">
<TextInput
placeholder="Москва, Россия"
label="Доставить посылку в"
tooltip="Укажите пункт (Город/Страна), куда необходимо доставить посылку."
value={toAddress}
handleChange={(e) => setToAddress(e.target.value)}
name="toAddress"
/>
</div>
<Button
text="Найти перевозчика"
className="flex-1 whitespace-nowrap bg-orange hover:bg-orange/80 text-white p-4"
/>
<Button
text="Найти посылку"
className="flex-1 whitespace-nowrap bg-gray-100 hover:bg-gray-200 text-gray-800 p-4"
/>
</div>
</div>
)
}