Skip to content

The complete open source platform to run your entire marketplace. Storefront, vendor panel, admin console, and integrations in one enterprise-grade platform you own.

feat(vendor): add cover image upload and display all seller fields

vholik2d224013a795
diff --git a/packages/vendor/src/components/common/file-upload/file-upload.tsx b/packages/vendor/src/components/common/file-upload/file-upload.tsx
index 41600abf2..bb052986a 100644
--- a/packages/vendor/src/components/common/file-upload/file-upload.tsx
+++ b/packages/vendor/src/components/common/file-upload/file-upload.tsx
@@ -1,113 +1,98 @@
-import { ArrowDownTray } from "@medusajs/icons"
-import { Text, clx } from "@medusajs/ui"
-import { ChangeEvent, DragEvent, useRef, useState } from "react"
+import { ArrowDownTray } from "@medusajs/icons";
+import { Text, clx } from "@medusajs/ui";
+import { ChangeEvent, DragEvent, useRef, useState } from "react";
export interface FileType {
- id: string
- url: string
- file: File
-}
-
-export interface RejectedFile {
- file: File
- reason: "size" | "format"
+ id: string;
+ url: string;
+ file: File;
}
export interface FileUploadProps {
- label: string
- multiple?: boolean
- hint?: string
- hasError?: boolean
- formats: string[]
- maxFileSize?: number // in bytes, defaults to 1MB. Set to Infinity to disable.
- onUploaded: (files: FileType[], rejectedFiles?: RejectedFile[]) => void
+ label: string;
+ multiple?: boolean;
+ hint?: string;
+ hasError?: boolean;
+ formats: string[];
+ onUploaded: (files: FileType[]) => void;
+ uploadedImage?: string | null;
}
-const DEFAULT_MAX_FILE_SIZE = 1024 * 1024 // 1MB
-
export const FileUpload = ({
label,
hint,
multiple = true,
hasError,
formats,
- maxFileSize = DEFAULT_MAX_FILE_SIZE,
onUploaded,
+ uploadedImage = "",
}: FileUploadProps) => {
- const [isDragOver, setIsDragOver] = useState<boolean>(false)
- const inputRef = useRef<HTMLInputElement>(null)
- const dropZoneRef = useRef<HTMLButtonElement>(null)
+ const [isDragOver, setIsDragOver] = useState<boolean>(false);
+ const inputRef = useRef<HTMLInputElement>(null);
+ const dropZoneRef = useRef<HTMLButtonElement>(null);
const handleOpenFileSelector = () => {
- inputRef.current?.click()
- }
+ inputRef.current?.click();
+ };
const handleDragEnter = (event: DragEvent) => {
- event.preventDefault()
- event.stopPropagation()
+ event.preventDefault();
+ event.stopPropagation();
- const files = event.dataTransfer?.files
+ const files = event.dataTransfer?.files;
if (!files) {
- return
+ return;
}
- setIsDragOver(true)
- }
+ setIsDragOver(true);
+ };
const handleDragLeave = (event: DragEvent) => {
- event.preventDefault()
- event.stopPropagation()
+ event.preventDefault();
+ event.stopPropagation();
if (
!dropZoneRef.current ||
dropZoneRef.current.contains(event.relatedTarget as Node)
) {
- return
+ return;
}
- setIsDragOver(false)
- }
+ setIsDragOver(false);
+ };
const handleUploaded = (files: FileList | null) => {
if (!files) {
- return
+ return;
}
- const fileList = Array.from(files)
- const validFiles: FileType[] = []
- const rejectedFiles: RejectedFile[] = []
- const normalizedMaxFileSize = Math.min(maxFileSize, Infinity)
+ const fileList = Array.from(files);
+ const fileObj = fileList.map((file) => {
+ const id = Math.random().toString(36).substring(7);
- fileList.forEach((file) => {
- if (file.size > normalizedMaxFileSize) {
- rejectedFiles.push({ file, reason: "size" })
- return
- }
-
- const id = Math.random().toString(36).substring(7)
- const previewUrl = URL.createObjectURL(file)
- validFiles.push({
+ const previewUrl = URL.createObjectURL(file);
+ return {
id: id,
url: previewUrl,
file,
- })
- })
+ };
+ });
- onUploaded(validFiles, rejectedFiles)
- }
+ onUploaded(fileObj);
+ };
const handleDrop = (event: DragEvent) => {
- event.preventDefault()
- event.stopPropagation()
+ event.preventDefault();
+ event.stopPropagation();
- setIsDragOver(false)
+ setIsDragOver(false);
- handleUploaded(event.dataTransfer?.files)
- }
+ handleUploaded(event.dataTransfer?.files);
+ };
const handleFileChange = async (event: ChangeEvent<HTMLInputElement>) => {
- handleUploaded(event.target.files)
- }
+ handleUploaded(event.target.files);
+ };
return (
<div>
@@ -126,21 +111,29 @@ export const FileUpload = ({
{
"!border-ui-border-error": hasError,
"!border-ui-border-interactive": isDragOver,
- }
+ },
)}
>
- <div className="text-ui-fg-subtle group-disabled:text-ui-fg-disabled flex items-center gap-x-2">
- <ArrowDownTray />
- <Text>{label}</Text>
- </div>
- {!!hint && (
- <Text
- size="small"
- leading="compact"
- className="text-ui-fg-muted group-disabled:text-ui-fg-disabled"
- >
- {hint}
- </Text>
+ {uploadedImage ? (
+ <div>
+ <img src={uploadedImage} className="w-32 h-32 rounded-md" />
+ </div>
+ ) : (
+ <>
+ <div className="text-ui-fg-subtle group-disabled:text-ui-fg-disabled flex items-center gap-x-2">
+ <ArrowDownTray />
+ <Text>{label}</Text>
+ </div>
+ {!!hint && (
+ <Text
+ size="small"
+ leading="compact"
+ className="text-ui-fg-muted group-disabled:text-ui-fg-disabled"
+ >
+ {hint}
+ </Text>
+ )}
+ </>
)}
</button>
<input
@@ -152,5 +145,5 @@ export const FileUpload = ({
multiple={multiple}
/>
</div>
- )
-}
+ );
+};
diff --git a/packages/vendor/src/components/common/image-avatar/image-avatar.tsx b/packages/vendor/src/components/common/image-avatar/image-avatar.tsx
index c436ba64b..587f8beeb 100644
--- a/packages/vendor/src/components/common/image-avatar/image-avatar.tsx
+++ b/packages/vendor/src/components/common/image-avatar/image-avatar.tsx
@@ -1,25 +1,25 @@
-import { clx } from "@medusajs/ui"
-import imagesConverter from "../../../utils/images-conventer"
+import { clx } from "@medusajs/ui";
+import imagesConverter from "../../../utils/images-conventer";
export default function ImageAvatar({
src,
size = 6,
rounded = false,
}: {
- src: string
- size?: number
- rounded?: boolean
+ src: string;
+ size?: number;
+ rounded?: boolean;
}) {
- const formattedSrc = imagesConverter(src)
+ const formattedSrc = imagesConverter(src);
return (
<img
src={formattedSrc}
alt="avatar"
className={clx(
- `w-${size} h-${size} border rounded-md`,
- rounded && "rounded-full"
+ `w-${size} h-${size} border rounded-md object-cover`,
+ rounded && "rounded-full",
)}
/>
- )
+ );
}
diff --git a/packages/vendor/src/pages/settings/profile/edit/_components/edit-profile-form.tsx b/packages/vendor/src/pages/settings/profile/edit/_components/edit-profile-form.tsx
index 108d874ab..de6f05ec4 100644
--- a/packages/vendor/src/pages/settings/profile/edit/_components/edit-profile-form.tsx
+++ b/packages/vendor/src/pages/settings/profile/edit/_components/edit-profile-form.tsx
@@ -1,30 +1,30 @@
-import { zodResolver } from "@hookform/resolvers/zod"
-import { Button, Input, Textarea, toast } from "@medusajs/ui"
-import { useFieldArray, useForm } from "react-hook-form"
-import { useTranslation } from "react-i18next"
-import * as zod from "zod"
-import { useCallback } from "react"
-import { HttpTypes } from "@medusajs/types"
-
-import { Form } from "@components/common/form"
-import { RouteDrawer, useRouteModal } from "@components/modals"
-import { KeyboundForm } from "@components/utilities/keybound-form"
-import { useUpdateUser } from "@hooks/api/users"
-import { TeamMemberProps } from "@custom-types/user"
-import { MediaSchema } from "@pages/products/create/constants"
-import { FileType, FileUpload } from "@components/common/file-upload"
-import { uploadFilesQuery } from "@lib/client"
+import { zodResolver } from "@hookform/resolvers/zod";
+import { Button, Input, Textarea, toast } from "@medusajs/ui";
+import { useFieldArray, useForm } from "react-hook-form";
+import { useTranslation } from "react-i18next";
+import * as zod from "zod";
+import { useCallback } from "react";
+import { HttpTypes } from "@medusajs/types";
+
+import { Form } from "@components/common/form";
+import { RouteDrawer, useRouteModal } from "@components/modals";
+import { KeyboundForm } from "@components/utilities/keybound-form";
+import { useUpdateUser } from "@hooks/api/users";
+import { TeamMemberProps } from "@custom-types/user";
+import { MediaSchema } from "@pages/products/create/constants";
+import { FileType, FileUpload } from "@components/common/file-upload";
+import { uploadFilesQuery } from "@lib/client";
type EditProfileProps = {
- user: TeamMemberProps
-}
+ user: TeamMemberProps;
+};
const EditProfileSchema = zod.object({
name: zod.string().optional(),
media: zod.array(MediaSchema).optional(),
phone: zod.string().optional(),
bio: zod.string().optional(),
-})
+});
const SUPPORTED_FORMATS = [
"image/jpeg",
@@ -33,7 +33,7 @@ const SUPPORTED_FORMATS = [
"image/webp",
"image/heic",
"image/svg+xml",
-]
+];
const SUPPORTED_FORMATS_FILE_EXTENSIONS = [
".jpeg",
@@ -42,11 +42,11 @@ const SUPPORTED_FORMATS_FILE_EXTENSIONS = [
".webp",
".heic",
".svg",
-]
+];
export const EditProfileForm = ({ user }: EditProfileProps) => {
- const { t } = useTranslation()
- const { handleSuccess } = useRouteModal()
+ const { t } = useTranslation();
+ const { handleSuccess } = useRouteModal();
const form = useForm<zod.infer<typeof EditProfileSchema>>({
defaultValues: {
@@ -56,37 +56,37 @@ export const EditProfileForm = ({ user }: EditProfileProps) => {
media: [],
},
resolver: zodResolver(EditProfileSchema),
- })
+ });
const { fields } = useFieldArray({
name: "media",
control: form.control,
keyName: "field_id",
- })
+ });
- const { mutateAsync, isPending } = useUpdateUser(user.id!)
+ const { mutateAsync, isPending } = useUpdateUser(user.id!);
const handleSubmit = form.handleSubmit(async (values) => {
let uploadedMedia: (HttpTypes.AdminFile & {
- isThumbnail: boolean
- })[] = []
+ isThumbnail: boolean;
+ })[] = [];
try {
if (values.media?.length) {
- const fileReqs = []
+ const fileReqs = [];
fileReqs.push(
uploadFilesQuery(values.media).then((r: any) =>
r.files.map((f: any) => ({
...f,
isThumbnail: false,
- }))
- )
- )
+ })),
+ ),
+ );
- uploadedMedia = (await Promise.all(fileReqs)).flat()
+ uploadedMedia = (await Promise.all(fileReqs)).flat();
}
} catch (error) {
if (error instanceof Error) {
- toast.error(error.message)
+ toast.error(error.message);
}
}
@@ -99,21 +99,21 @@ export const EditProfileForm = ({ user }: EditProfileProps) => {
},
{
onError: (error) => {
- toast.error(error.message)
- return
+ toast.error(error.message);
+ return;
},
- }
- )
+ },
+ );
- toast.success(t("profile.toast.edit"))
- handleSuccess()
- })
+ toast.success(t("profile.toast.edit"));
+ handleSuccess();
+ });
const hasInvalidFiles = useCallback(
(fileList: FileType[]) => {
const invalidFile = fileList.find(
- (f) => !SUPPORTED_FORMATS.includes(f.file.type)
- )
+ (f) => !SUPPORTED_FORMATS.includes(f.file.type),
+ );
if (invalidFile) {
form.setError("media", {
@@ -122,27 +122,27 @@ export const EditProfileForm = ({ user }: EditProfileProps) => {
name: invalidFile.file.name,
types: SUPPORTED_FORMATS_FILE_EXTENSIONS.join(", "),
}),
- })
+ });
- return true
+ return true;
}
- return false
+ return false;
},
- [form, t]
- )
+ [form, t],
+ );
const onUploaded = useCallback(
(files: FileType[]) => {
- form.clearErrors("media")
+ form.clearErrors("media");
if (hasInvalidFiles(files)) {
- return
+ return;
}
- form.setValue("media", [{ ...files[0], isThumbnail: false }])
+ form.setValue("media", [{ ...files[0], isThumbnail: false }]);
},
- [form, hasInvalidFiles]
- )
+ [form, hasInvalidFiles],
+ );
return (
<RouteDrawer.Form form={form}>
@@ -173,7 +173,7 @@ export const EditProfileForm = ({ user }: EditProfileProps) => {
<Form.ErrorMessage />
</div>
</Form.Item>
- )
+ );
}}
/>
<Form.Field
@@ -231,5 +231,5 @@ export const EditProfileForm = ({ user }: EditProfileProps) => {
</RouteDrawer.Footer>
</KeyboundForm>
</RouteDrawer.Form>
- )
-}
+ );
+};
diff --git a/packages/vendor/src/pages/settings/seller/_components/seller-general-section.tsx b/packages/vendor/src/pages/settings/seller/_components/seller-general-section.tsx
index eb1bc690b..1ed02f7ee 100644
--- a/packages/vendor/src/pages/settings/seller/_components/seller-general-section.tsx
+++ b/packages/vendor/src/pages/settings/seller/_components/seller-general-section.tsx
@@ -17,7 +17,6 @@ export const SellerGeneralSection = ({ seller }: StoreGeneralSectionProps) => {
<Container className="divide-y p-0">
<div className="flex items-center justify-between px-6 py-4">
<div className="flex items-center gap-x-4">
- {seller.logo && <ImageAvatar src={seller.logo} size={12} />}
<div>
<Heading>{seller.name}</Heading>
<Text className="text-ui-fg-subtle" size="small">
@@ -39,6 +38,30 @@ export const SellerGeneralSection = ({ seller }: StoreGeneralSectionProps) => {
]}
/>
</div>
+ <div className="text-ui-fg-subtle grid grid-cols-2 px-6 py-4">
+ <Text size="small" leading="compact" weight="plus">
+ {t("store.logo", "Logo")}
+ </Text>
+ {seller.logo ? (
+ <ImageAvatar src={seller.logo} size={12} />
+ ) : (
+ <Text size="small" leading="compact">
+ {"-"}
+ </Text>
+ )}
+ </div>
+ <div className="text-ui-fg-subtle grid grid-cols-2 px-6 py-4">
+ <Text size="small" leading="compact" weight="plus">
+ {t("store.coverImage", "Cover image")}
+ </Text>
+ {seller.cover_image ? (
+ <ImageAvatar src={seller.cover_image} size={12} />
+ ) : (
+ <Text size="small" leading="compact">
+ {"-"}
+ </Text>
+ )}
+ </div>
<div className="text-ui-fg-subtle grid grid-cols-2 px-6 py-4">
<Text size="small" leading="compact" weight="plus">
{t("fields.name")}
@@ -47,6 +70,14 @@ export const SellerGeneralSection = ({ seller }: StoreGeneralSectionProps) => {
{seller.name || "-"}
</Text>
</div>
+ <div className="text-ui-fg-subtle grid grid-cols-2 px-6 py-4">
+ <Text size="small" leading="compact" weight="plus">
+ {t("fields.handle")}
+ </Text>
+ <Text size="small" leading="compact">
+ {seller.handle || "-"}
+ </Text>
+ </div>
<div className="text-ui-fg-subtle grid grid-cols-2 px-6 py-4">
<Text size="small" leading="compact" weight="plus">
{t("fields.email")}
@@ -68,15 +99,47 @@ export const SellerGeneralSection = ({ seller }: StoreGeneralSectionProps) => {
{t("fields.address")}
</Text>
<Text size="small" leading="compact">
- {[
- seller.address_1,
- seller.city,
- seller.province,
- seller.postal_code,
- seller.country_code,
- ]
- .filter(Boolean)
- .join(", ") || "-"}
+ {seller.address_1 || "-"}
+ </Text>
+ </div>
+ <div className="text-ui-fg-subtle grid grid-cols-2 px-6 py-4">
+ <Text size="small" leading="compact" weight="plus">
+ {t("fields.address2")}
+ </Text>
+ <Text size="small" leading="compact">
+ {seller.address_2 || "-"}
+ </Text>
+ </div>
+ <div className="text-ui-fg-subtle grid grid-cols-2 px-6 py-4">
+ <Text size="small" leading="compact" weight="plus">
+ {t("fields.city")}
+ </Text>
+ <Text size="small" leading="compact">
+ {seller.city || "-"}
+ </Text>
+ </div>
+ <div className="text-ui-fg-subtle grid grid-cols-2 px-6 py-4">
+ <Text size="small" leading="compact" weight="plus">
+ {t("fields.state")}
+ </Text>
+ <Text size="small" leading="compact">
+ {seller.province || "-"}
+ </Text>
+ </div>
+ <div className="text-ui-fg-subtle grid grid-cols-2 px-6 py-4">
+ <Text size="small" leading="compact" weight="plus">
+ {t("fields.postalCode")}
+ </Text>
+ <Text size="small" leading="compact">
+ {seller.postal_code || "-"}
+ </Text>
+ </div>
+ <div className="text-ui-fg-subtle grid grid-cols-2 px-6 py-4">
+ <Text size="small" leading="compact" weight="plus">
+ {t("fields.country")}
+ </Text>
+ <Text size="small" leading="compact">
+ {seller.country_code || "-"}
</Text>
</div>
</Container>
diff --git a/packages/vendor/src/pages/settings/seller/edit/_components/edit-seller-form.tsx b/packages/vendor/src/pages/settings/seller/edit/_components/edit-seller-form.tsx
index aea42acc5..890271b78 100644
--- a/packages/vendor/src/pages/settings/seller/edit/_components/edit-seller-form.tsx
+++ b/packages/vendor/src/pages/settings/seller/edit/_components/edit-seller-form.tsx
@@ -6,7 +6,6 @@ import * as zod from "zod";
import { FileType, FileUpload } from "@components/common/file-upload";
import { Form } from "@components/common/form";
-import ImageAvatar from "@components/common/image-avatar/image-avatar";
import { CountrySelect } from "@components/inputs/country-select";
import { RouteDrawer, useRouteModal } from "@components/modals";
import { KeyboundForm } from "@components/utilities/keybound-form";
@@ -14,6 +13,7 @@ import { useUpdateMe } from "@hooks/api";
import { uploadFilesQuery } from "@lib/client";
import { MediaSchema } from "@pages/products/create/constants";
import { HttpTypes } from "@mercurjs/types";
+import { useCallback } from "react";
type EditSellerFormProps = HttpTypes.StoreSellerResponse;
@@ -31,6 +31,7 @@ const EditSellerSchema = zod.object({
country_code: zod.string().optional().or(zod.literal("")),
}),
media: zod.array(MediaSchema).optional(),
+ coverMedia: zod.array(MediaSchema).optional(),
});
const SUPPORTED_FORMATS = [
@@ -70,26 +71,38 @@ export const EditSellerForm = ({ seller }: EditSellerFormProps) => {
country_code: seller.country_code ?? "",
},
media: [],
+ coverMedia: [],
},
resolver: zodResolver(EditSellerSchema),
});
- const { fields } = useFieldArray({
+ const { fields: logoFields } = useFieldArray({
name: "media",
control: form.control,
keyName: "field_id",
});
+ const { fields: coverFields } = useFieldArray({
+ name: "coverMedia",
+ control: form.control,
+ keyName: "field_id",
+ });
+
const { mutateAsync, isPending } = useUpdateMe();
const handleSubmit = form.handleSubmit(async (values) => {
let logoUrl = seller.logo || "";
+ let coverImageUrl = seller.cover_image || "";
try {
if (values.media?.length) {
const uploaded = await uploadFilesQuery(values.media);
logoUrl = uploaded.files?.[0]?.url || logoUrl;
}
+ if (values.coverMedia?.length) {
+ const uploaded = await uploadFilesQuery(values.coverMedia);
+ coverImageUrl = uploaded.files?.[0]?.url || coverImageUrl;
+ }
} catch (error) {
if (error instanceof Error) {
toast.error(error.message);
@@ -103,13 +116,14 @@ export const EditSellerForm = ({ seller }: EditSellerFormProps) => {
email: values.email || undefined,
phone: values.phone || null,
logo: logoUrl || null,
+ cover_image: coverImageUrl || null,
address_1: values.address.address_1 || null,
address_2: values.address.address_2 || null,
city: values.address.city || null,
province: values.address.province || null,
postal_code: values.address.postal_code || null,
country_code: values.address.country_code || null,
- } as any,
+ },
{
onSuccess: () => {
toast.success(t("app.menus.seller.sellerSettings"));
@@ -122,25 +136,47 @@ export const EditSellerForm = ({ seller }: EditSellerFormProps) => {
);
});
- // File validation and upload — instead of useCallback, inline for simplicity (matches Location Form simpleness)
- const onUploaded = (files: FileType[]) => {
- const invalidFile = files.find(
- (f) => !SUPPORTED_FORMATS.includes(f.file.type),
- );
- if (invalidFile) {
- form.setError("media", {
- type: "invalid_file",
- message: t("products.media.invalidFileType", {
- name: invalidFile.file.name,
- types: SUPPORTED_FORMATS_FILE_EXTENSIONS.join(", "),
- }),
- });
+ const hasInvalidFiles = useCallback(
+ (fileList: FileType[]) => {
+ const invalidFile = fileList.find(
+ (f) => !SUPPORTED_FORMATS.includes(f.file.type),
+ );
+
+ if (invalidFile) {
+ form.setError("media", {
+ type: "invalid_file",
+ message: t("products.media.invalidFileType", {
+ name: invalidFile.file.name,
+ types: SUPPORTED_FORMATS_FILE_EXTENSIONS.join(", "),
+ }),
+ });
+
+ return true;
+ }
+
+ return false;
+ },
+ [form, t],
+ );
+
+ const onLogoUploaded = (files: FileType[]) => {
+ form.clearErrors("media");
+ if (hasInvalidFiles(files)) {
return;
}
- form.clearErrors("media");
+
form.setValue("media", [{ ...files[0], isThumbnail: false }]);
};
+ const onCoverUploaded = (files: FileType[]) => {
+ form.clearErrors("coverMedia");
+ if (hasInvalidFiles(files)) {
+ return;
+ }
+
+ form.setValue("coverMedia", [{ ...files[0], isThumbnail: false }]);
+ };
+
return (
<RouteDrawer.Form form={form}>
<KeyboundForm
@@ -153,24 +189,48 @@ export const EditSellerForm = ({ seller }: EditSellerFormProps) => {
name="media"
control={form.control}
render={() => {
- const previewUrl = fields[0]?.url || seller.logo;
+ const previewUrl = logoFields[0]?.url || seller.logo;
return (
<Form.Item>
<Form.Label>{t("store.logo", "Logo")}</Form.Label>
- {previewUrl && (
- <div className="mb-2">
- <ImageAvatar src={previewUrl} size={16} />
- </div>
- )}
<Form.Control>
<FileUpload
+ uploadedImage={previewUrl}
multiple={false}
label={t("products.media.uploadImagesLabel")}
hint={t("products.media.uploadImagesHint")}
hasError={!!form.formState.errors.media}
formats={SUPPORTED_FORMATS}
- onUploaded={onUploaded}
+ onUploaded={onLogoUploaded}
+ />
+ </Form.Control>
+ <Form.ErrorMessage />
+ </Form.Item>
+ );
+ }}
+ />
+ <Form.Field
+ name="coverMedia"
+ control={form.control}
+ render={() => {
+ const previewUrl =
+ coverFields[0]?.url || seller.cover_image;
+
+ return (
+ <Form.Item>
+ <Form.Label>
+ {t("store.coverImage", "Cover image")}
+ </Form.Label>
+ <Form.Control>
+ <FileUpload
+ uploadedImage={previewUrl}
+ multiple={false}
+ label={t("products.media.uploadImagesLabel")}
+ hint={t("products.media.uploadImagesHint")}
+ hasError={!!form.formState.errors.coverMedia}
+ formats={SUPPORTED_FORMATS}
+ onUploaded={onCoverUploaded}
/>
</Form.Control>
<Form.ErrorMessage />
@@ -257,32 +317,6 @@ export const EditSellerForm = ({ seller }: EditSellerFormProps) => {
</Form.Item>
)}
/>
- <Form.Field
- control={form.control}
- name="address.company"
- render={({ field }) => (
- <Form.Item>
- <Form.Label optional>{t("fields.company")}</Form.Label>
- <Form.Control>
- <Input size="small" {...field} />
- </Form.Control>
- <Form.ErrorMessage />
- </Form.Item>
- )}
- />
- <Form.Field
- control={form.control}
- name="address.phone"
- render={({ field }) => (
- <Form.Item>
- <Form.Label optional>{t("fields.phone")}</Form.Label>
- <Form.Control>
- <Input size="small" {...field} />
- </Form.Control>
- <Form.ErrorMessage />
- </Form.Item>
- )}
- />
<Form.Field
control={form.control}
name="address.city"