feat add company links
continuous-integration/drone/push Build is passing

This commit is contained in:
AmirReza Jamali
2026-07-11 15:34:13 +03:30
parent 37aa916ad5
commit 624614f1a9
10 changed files with 278 additions and 33 deletions
@@ -11,6 +11,7 @@ import type { ILabelValue } from "@/types/shared";
import type { UseFormSetValue, UseFormWatch } from "react-hook-form";
import { v4 as uuidv4 } from "uuid";
import CompanyDocuments from "./documents/CompanyDocuments";
import CompanyLinks from "./links/CompanyLinks";
const companyInformationSectionId = uuidv4();
const businessInformationSectionId = uuidv4();
@@ -18,6 +19,7 @@ const settingsSectionId = uuidv4();
const addressSectionId = uuidv4();
const tagsSectionId = uuidv4();
const documentsSectionId = uuidv4();
const linksSectionId = uuidv4();
interface CompanyFormSectionsOptions {
editMode?: boolean;
@@ -169,9 +171,8 @@ const getTimezoneOffsetMinutes = (timezone: string, date = new Date()) => {
timeZoneName: "shortOffset",
});
const offset =
formatter
.formatToParts(date)
.find((part) => part.type === "timeZoneName")?.value ?? "";
formatter.formatToParts(date).find((part) => part.type === "timeZoneName")
?.value ?? "";
const label = offset.replace(/^GMT/, "") || "+0";
const match = label.match(/^([+-])(\d{1,2})(?::(\d{2}))?$/);
@@ -667,4 +668,19 @@ export const createCompanyFormSections = ({
},
],
},
{
id: linksSectionId,
title: "Links",
rootClassName: "lg:col-span-2",
className: "md:grid-cols-1",
fields: [
{
kind: "custom",
name: "links",
render: ({ control, errors, register }) => (
<CompanyLinks control={control} errors={errors} register={register} />
),
},
],
},
];