Quiz_dashboard/src/Components/CustomFields/SelectAndTime.tsx
karimaldeen 7aa8d50cfd fix
2024-09-07 12:16:10 +03:00

56 lines
1.4 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { DatePicker, Select } from "antd";
import React from "react";
const SelectAndTime = () => {
const onChange: any["onChange"] = (date: any, dateString: any) => {
// console.log(date, dateString);
};
const onChangeSearch = (value: string) => {
// console.log(`selected ${value}`);
};
const onSearch = (value: string) => {
// console.log('search:', value);
};
// Filter `option.label` match the user type `input`
const filterOption = (
input: string,
option?: { label: string; value: string },
) => (option?.label ?? "").toLowerCase().includes(input.toLowerCase());
return (
<div className="SelectAndTime w-100">
<label className="text">تاريخ & مكان الولادة *</label>
<div className="TowItemField">
<DatePicker size="large" onChange={onChange} picker="month" />
<Select
showSearch
placeholder="Select a person"
optionFilterProp="children"
onChange={onChange}
onSearch={onChangeSearch}
filterOption={filterOption}
size="large"
options={[
{
value: "jack",
label: "Jack",
},
{
value: "lucy",
label: "Lucy",
},
{
value: "tom",
label: "Tom",
},
]}
/>
</div>
</div>
);
};
export default SelectAndTime;