2024-03-03 22:34:43 -05:00
|
|
|
import { faClock } from "@fortawesome/free-regular-svg-icons"
|
|
|
|
|
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"
|
2024-03-03 22:09:33 -05:00
|
|
|
import React from "react"
|
|
|
|
|
import SelectInput from "./SelectInput"
|
|
|
|
|
import { Utils } from "./Utils"
|
|
|
|
|
|
|
|
|
|
// Define a type for your props to improve type-checking
|
|
|
|
|
type ClientFieldProps = {
|
2024-03-03 22:34:43 -05:00
|
|
|
testingCenters: string[]
|
|
|
|
|
clients: string[]
|
2024-03-03 22:09:33 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Destructure the props in the function parameter
|
|
|
|
|
const ClientField: React.FC<ClientFieldProps> = ({ testingCenters, clients }) => {
|
|
|
|
|
return (
|
2024-03-04 23:33:49 -05:00
|
|
|
<div className="flex flex-col gap-4 text-sm leading-tight">
|
2024-03-03 22:09:33 -05:00
|
|
|
{testingCenters.map((testingCenter) => (
|
2024-03-03 22:34:43 -05:00
|
|
|
<div key={Utils.camelize(testingCenter)} className="flex items-center gap-14">
|
2024-03-03 22:09:33 -05:00
|
|
|
<span>{testingCenter}</span>
|
2024-03-03 22:34:43 -05:00
|
|
|
<div className="flex items-center gap-2">
|
2024-03-03 22:09:33 -05:00
|
|
|
<SelectInput name={Utils.camelize(testingCenter)}>
|
2024-03-03 22:34:43 -05:00
|
|
|
<option value="">Select Client</option>
|
|
|
|
|
{clients.map((option: string) => (
|
|
|
|
|
<option key={option} value={option}>
|
|
|
|
|
{option}
|
|
|
|
|
</option>
|
|
|
|
|
))}
|
|
|
|
|
</SelectInput>
|
|
|
|
|
<FontAwesomeIcon icon={faClock} />
|
|
|
|
|
</div>
|
2024-03-03 22:09:33 -05:00
|
|
|
</div>
|
|
|
|
|
))}
|
|
|
|
|
</div>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default ClientField
|