mirror of
https://github.com/tomru/pfadi-bussle.git
synced 2026-03-03 06:27:11 +01:00
46 lines
1.2 KiB
TypeScript
46 lines
1.2 KiB
TypeScript
import React from 'react'
|
|
|
|
export default function Select({
|
|
label,
|
|
name,
|
|
value,
|
|
onChange,
|
|
children,
|
|
}: {
|
|
label: string
|
|
name: string
|
|
value: string
|
|
onChange: (e: React.ChangeEvent<HTMLSelectElement>) => void
|
|
children: React.ReactNode
|
|
}) {
|
|
return (
|
|
<div className="fsw">
|
|
<div className="fs">
|
|
<label className="flabel" htmlFor={name}>
|
|
{label}
|
|
</label>
|
|
<div className="relative">
|
|
<select
|
|
className="block appearance-none w-full bg-gray-200 border border-gray-200 text-gray-700 py-3 px-4 pr-8 rounded-sm leading-tight focus:outline-hidden focus:bg-white focus:border-gray-500"
|
|
id={name}
|
|
name={name}
|
|
value={value}
|
|
onChange={onChange}
|
|
>
|
|
{children}
|
|
</select>
|
|
<div className="pointer-events-none absolute inset-y-0 right-0 flex items-center px-2 text-gray-700">
|
|
<svg
|
|
className="fill-current h-4 w-4"
|
|
xmlns="http://www.w3.org/2000/svg"
|
|
viewBox="0 0 20 20"
|
|
>
|
|
<path d="M9.293 12.95l.707.707L15.657 8l-1.414-1.414L10 10.828 5.757 6.586 4.343 8z" />
|
|
</svg>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
)
|
|
}
|