Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

page.tsx 2.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. 'use client'
  2. import BaseForm from '../components/base/form/form-scenarios/base'
  3. import { BaseFieldType } from '../components/base/form/form-scenarios/base/types'
  4. export default function Page() {
  5. return (
  6. <div className='flex h-screen w-full items-center justify-center p-20'>
  7. <div className='w-[400px] rounded-lg border border-components-panel-border bg-components-panel-bg'>
  8. <BaseForm
  9. initialData={{
  10. type: 'option_1',
  11. variable: 'test',
  12. label: 'Test',
  13. maxLength: 48,
  14. required: true,
  15. }}
  16. configurations={[
  17. {
  18. type: BaseFieldType.textInput,
  19. variable: 'variable',
  20. label: 'Variable',
  21. required: true,
  22. showConditions: [],
  23. },
  24. {
  25. type: BaseFieldType.textInput,
  26. variable: 'label',
  27. label: 'Label',
  28. required: true,
  29. showConditions: [],
  30. },
  31. {
  32. type: BaseFieldType.numberInput,
  33. variable: 'maxLength',
  34. label: 'Max Length',
  35. required: true,
  36. showConditions: [],
  37. max: 100,
  38. min: 1,
  39. },
  40. {
  41. type: BaseFieldType.checkbox,
  42. variable: 'required',
  43. label: 'Required',
  44. required: true,
  45. showConditions: [],
  46. },
  47. {
  48. type: BaseFieldType.select,
  49. variable: 'type',
  50. label: 'Type',
  51. required: true,
  52. showConditions: [],
  53. options: [
  54. { label: 'Option 1', value: 'option_1' },
  55. { label: 'Option 2', value: 'option_2' },
  56. { label: 'Option 3', value: 'option_3' },
  57. ],
  58. },
  59. ]}
  60. onSubmit={(value) => {
  61. console.log('onSubmit', value)
  62. }}
  63. />
  64. </div>
  65. </div>
  66. )
  67. }