feat(companies): Enhance company forms with additional fields
This commit expands the company profile by adding several new fields to the create and edit forms. This allows for the collection of more detailed and comprehensive company information. Key changes include: - Added new fields: Establishment Date, Company Type, Business Nature, Industry, Country, State, and City. - Introduced a new reusable `DatePicker` component, utilizing `react-datepicker`, for date input. - Created a new `CalendarIcon` for use in the date picker. - Updated the company Zod schema, API services, and data types to support the new fields. Additionally, this commit includes a refactor to standardize the `MultiSelect` component by renaming the `text` prop to `label` for better consistency across form elements. Form labels are now capitalized for a uniform UI.
This commit is contained in:
@@ -11,13 +11,13 @@ import {
|
||||
|
||||
interface Option {
|
||||
value: string;
|
||||
text: string;
|
||||
label: string;
|
||||
selected: boolean;
|
||||
}
|
||||
|
||||
type MultiSelectProps<T extends FieldValues> = {
|
||||
label: string;
|
||||
items: { value: string; text: string }[];
|
||||
items: { value: string; label: string }[];
|
||||
value?: string[];
|
||||
errors?: FieldErrors<T>;
|
||||
required?: boolean;
|
||||
@@ -138,7 +138,7 @@ function MultiSelect<T extends FieldValues>({
|
||||
<div className={className}>
|
||||
<label
|
||||
htmlFor={id}
|
||||
className="text-body-sm font-medium text-dark dark:text-white"
|
||||
className="text-body-sm font-medium capitalize text-dark dark:text-white"
|
||||
>
|
||||
{label}
|
||||
{required && <span className="ml-1 select-none text-error">*</span>}
|
||||
@@ -165,7 +165,7 @@ function MultiSelect<T extends FieldValues>({
|
||||
key={index}
|
||||
className="inline-flex items-center gap-1 rounded-md bg-primary/10 px-2.5 py-1 text-sm font-medium text-primary dark:bg-primary/20"
|
||||
>
|
||||
{options[index]?.text}
|
||||
{options[index]?.label}
|
||||
{!disabled && (
|
||||
<button
|
||||
type="button"
|
||||
@@ -245,7 +245,7 @@ function MultiSelect<T extends FieldValues>({
|
||||
</svg>
|
||||
)}
|
||||
</div>
|
||||
{option.text}
|
||||
{option.label}
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user