feat: enhance DoctorFormPage with searchable specialties and improved UI components
- Refactored DoctorFormPage to use Controller from react-hook-form for better form handling. - Added a new Field component for consistent input styling and error handling. - Implemented a SpecialtyPicker component with improved selection logic for specialties. - Updated the layout and styling of the form sections for better user experience. - Integrated SearchableSelect for selecting specialties and roles in DoctorsPage and UsersPage. - Added createClinic API endpoint to handle clinic creation with validation for mobile and name fields.
This commit is contained in:
@@ -9,6 +9,7 @@ import { api } from '../lib/api';
|
||||
import type { ApiResponse } from '../lib/api';
|
||||
import type { Blog } from '../types';
|
||||
import PageHeader from '../components/ui/PageHeader';
|
||||
import SearchableSelect from '../components/ui/SearchableSelect';
|
||||
|
||||
const schema = z.object({
|
||||
title: z.string().min(3, 'عنوان الزامی است'),
|
||||
@@ -134,11 +135,14 @@ export default function BlogFormPage() {
|
||||
control={control}
|
||||
name="status"
|
||||
render={({ field }) => (
|
||||
<select {...field}
|
||||
className="cp-input h-11">
|
||||
<option value="draft">پیشنویس</option>
|
||||
<option value="published">منتشر</option>
|
||||
</select>
|
||||
<SearchableSelect
|
||||
options={[
|
||||
{ value: 'draft', label: 'پیشنویس' },
|
||||
{ value: 'published', label: 'منتشر شده' },
|
||||
]}
|
||||
value={field.value ?? null}
|
||||
onChange={(v) => field.onChange(v ?? 'draft')}
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user