Skip to content

Commit

Permalink
feat: form item for vFolder name to check for duplicate names
Browse files Browse the repository at this point in the history
  • Loading branch information
yomybaby committed Jun 28, 2024
1 parent 3ee25dd commit c8e1908
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions react/src/components/VFolderNameFormItem.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { Form, FormItemProps, Input } from 'antd';
import { useTranslation } from 'react-i18next';

interface VFolderNameInputProps extends FormItemProps {
onChangeDuplicatedNameStatus?: (status: boolean) => void;
}

const VFolderNameFormItem: React.FC<VFolderNameInputProps> = ({ ...props }) => {
const { t } = useTranslation();
return (
<Form.Item
label={t('data.Foldername')}
rules={[
{
required: true,
},
{
pattern: /^[a-zA-Z0-9._-]*$/,
message: t('data.Allowslettersnumbersand-_dot'),
},
]}
{...props}
>
<Input autoComplete="off" />
</Form.Item>
);
};

export default VFolderNameFormItem;

0 comments on commit c8e1908

Please sign in to comment.