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:
AmirReza Jamali
2025-09-27 16:33:13 +03:30
parent 527d8e7661
commit bb56e1013a
22 changed files with 628 additions and 29 deletions
@@ -2,8 +2,6 @@
import { EyeIcon } from "@/assets/icons";
import { ShowcaseSection } from "@/components/Layouts/showcase-section";
import Pagination from "@/components/ui/pagination";
import { _TooltipDefaultParams } from "@/constants/tooltip";
import { Tooltip } from "react-tooltip";
import Status from "@/components/ui/Status";
import {
Table,
@@ -14,7 +12,10 @@ import {
TableRow,
} from "@/components/ui/table";
import TableSkeleton from "@/components/ui/TableSkeleton";
import { _TooltipDefaultParams } from "@/constants/tooltip";
import { isoStringToDate } from "@/utils/shared";
import Link from "next/link";
import { Tooltip } from "react-tooltip";
import useNotificationHistoryTablePresenter from "./useNotificationHistoryTablePresenter";
const NotificationHistoryTable = () => {
@@ -29,7 +30,10 @@ const NotificationHistoryTable = () => {
} = useNotificationHistoryTablePresenter();
return (
<ShowcaseSection>
<ShowcaseSection className="flex flex-col">
<button className="mb-5 flex w-fit justify-center self-end rounded-lg bg-primary p-[13px] font-medium text-white hover:bg-opacity-90">
<Link href={`${pathName}/create`}>Create Notification </Link>
</button>
<Table>
<TableHeader>
<TableRow>
@@ -96,7 +100,7 @@ const NotificationHistoryTable = () => {
</TableBody>
</Table>
<Pagination
currentPage={metadata?.page ? metadata?.page - 1 : 1}
currentPage={metadata?.page ? metadata?.page - 1 : 0}
totalPages={metadata?.pages ?? 1}
onPageChange={(e) => {
setParams((currentParams) => ({
@@ -9,6 +9,7 @@ const useNotificationHistoryTablePresenter = () => {
...apiDefaultParams,
});
const { data, isLoading } = useGetNotificationHistoryQuery(params);
const columns: string[] = [
"row",
"title",
@@ -24,7 +25,7 @@ const useNotificationHistoryTablePresenter = () => {
const pathName = usePathname();
const router = useRouter();
return {
notificationHistory: data?.data.notifications,
notificationHistory: data?.data,
metadata: data?.meta,
isLoading,
columns,