Browse Source

chore(area-management-ui): 删除未使用的AreaSelectField组件

- 删除 packages/area-management-ui/src/components/AreaSelectField.tsx
- 该组件未被使用,使用 AreaSelectForm 替代

🤖 Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
yourname 2 weeks ago
parent
commit
c48a05f671
1 changed files with 0 additions and 62 deletions
  1. 0 62
      packages/area-management-ui/src/components/AreaSelectField.tsx

+ 0 - 62
packages/area-management-ui/src/components/AreaSelectField.tsx

@@ -1,62 +0,0 @@
-import React from 'react';
-import { Controller, useFormContext } from 'react-hook-form';
-import { AreaSelect } from './AreaSelect';
-import { FormControl, FormDescription, FormItem, FormLabel, FormMessage } from '@d8d/shared-ui-components/components/ui/form';
-
-interface AreaSelectFieldProps {
-  name: string;
-  label?: string;
-  description?: string;
-  required?: boolean;
-  disabled?: boolean;
-  className?: string;
-}
-
-export const AreaSelectField: React.FC<AreaSelectFieldProps> = ({
-  name,
-  label = '地区选择',
-  description,
-  required = false,
-  disabled = false,
-  className
-}) => {
-  const { control } = useFormContext();
-
-  return (
-    <Controller
-      name={name}
-      control={control}
-      render={({ field, fieldState }) => {
-        // 将字段值转换为 AreaSelect 需要的格式
-        const value = {
-          provinceId: field.value?.provinceId || undefined,
-          cityId: field.value?.cityId || undefined,
-          districtId: field.value?.districtId || undefined
-        };
-
-        return (
-          <FormItem className={className}>
-            {label && (
-              <FormLabel>
-                {label}{required && <span className="text-destructive">*</span>}
-              </FormLabel>
-            )}
-            <FormControl>
-              <AreaSelect
-                value={value}
-                onChange={(newValue) => {
-                  // 更新表单字段值
-                  field.onChange(newValue);
-                }}
-                disabled={disabled}
-                required={required}
-              />
-            </FormControl>
-            {description && <FormDescription>{description}</FormDescription>}
-            <FormMessage>{fieldState.error?.message}</FormMessage>
-          </FormItem>
-        );
-      }}
-    />
-  );
-};