1
0
ohmyform/ui/components/form/admin/base.data.tab.tsx
Michael Schramm 9c4c325e5a
Switch to single branch (#221)
* remove submodules
* add api and ui files
* update github actions
* use sparse checkout
* update node setup
* update checkout
* update docker
* change permissions
* update mariadb health check
* update changelog
2023-12-02 19:22:40 +01:00

70 lines
1.7 KiB
TypeScript

import { Form, Input, Select, Switch, Tabs } from 'antd'
import { TabPaneProps } from 'antd/lib/tabs'
import React from 'react'
import { useTranslation } from 'react-i18next'
import { languages } from '../../../i18n'
export const BaseDataTab: React.FC<TabPaneProps> = (props) => {
const { t } = useTranslation()
return (
<Tabs.TabPane {...props}>
<Form.Item
label={t('form:baseData.isLive')}
name={['form', 'isLive']}
valuePropName={'checked'}
>
<Switch />
</Form.Item>
<Form.Item
label={t('form:baseData.title')}
name={['form', 'title']}
rules={[
{
required: true,
message: t('validation:titleRequired'),
},
]}
>
<Input />
</Form.Item>
<Form.Item
label={t('form:baseData.language')}
name={['form', 'language']}
rules={[
{
required: true,
message: t('validation:languageRequired'),
},
]}
>
<Select>
{languages.map((language) => (
<Select.Option value={language} key={language}>
{t(`language:${language}`)}
</Select.Option>
))}
</Select>
</Form.Item>
<Form.Item
label={t('form:baseData.showFooter')}
name={['form', 'showFooter']}
valuePropName={'checked'}
>
<Switch />
</Form.Item>
<Form.Item
label={t('form:baseData.anonymousSubmission')}
name={['form', 'anonymousSubmission']}
valuePropName={'checked'}
>
<Switch />
</Form.Item>
</Tabs.TabPane>
)
}