Proyectos de Subversion LeadersLinked - SPA

Rev

Rev 3215 | Rev 3217 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 3215 Rev 3216
Línea 1... Línea 1...
1
import React from 'react'
1
import React from 'react'
-
 
2
import { useOutletContext } from 'react-router-dom'
2
import { Controller, useForm } from 'react-hook-form'
3
import { Controller, useForm } from 'react-hook-form'
3
import { Button, InputLabel } from '@mui/material'
4
import { Button, InputLabel } from '@mui/material'
4
import Datetime from 'react-datetime'
5
import Datetime from 'react-datetime'
Línea 5... Línea 6...
5
 
6
 
6
import Form from '@components/common/form'
7
import Form from '@components/common/form'
7
import Input from '@components/UI/inputs/Input'
8
import Input from '@components/UI/inputs/Input'
8
import Ckeditor from '@components/UI/Ckeditor'
9
import Ckeditor from '@components/UI/Ckeditor'
9
import TagsInput from '@components/UI/TagsInput'
10
import TagsInput from '@components/UI/TagsInput'
10
import LoadingWrapper from '@components/common/loading-wrapper'
11
import LoadingWrapper from '@components/common/loading-wrapper'
-
 
12
import FormErrorFeedback from '@components/UI/form/FormErrorFeedback'
Línea 11... Línea 13...
11
import FormErrorFeedback from '@components/UI/form/FormErrorFeedback'
13
import { useFetch } from '@hooks'
12
 
14
 
13
export default function GoalForm({
15
export default function GoalForm({
14
  onSubmit = () => {},
16
  onSubmit = () => {},
15
  defaultValues = {},
17
  defaultValues = {},
-
 
18
  values = {}
-
 
19
}) {
-
 
20
  const context = useOutletContext()
-
 
21
  const {
-
 
22
    data: { items: habits }
16
  values = {}
23
  } = useFetch(context.link_skills, { items: [] })
17
}) {
24
 
18
  const {
25
  const {
19
    control,
26
    control,
20
    handleSubmit,
27
    handleSubmit,
Línea 67... Línea 74...
67
            <>
74
            <>
68
              <TagsInput
75
              <TagsInput
69
                name={name}
76
                name={name}
70
                label='Habitos'
77
                label='Habitos'
71
                onChange={onChange}
78
                onChange={onChange}
72
                suggestions={[]}
79
                suggestions={habits}
73
              />
80
              />
74
              {errors.skill_id && (
81
              {errors.skill_id && (
75
                <FormErrorFeedback>
82
                <FormErrorFeedback>
76
                  {errors.skill_id?.message}
83
                  {errors.skill_id?.message}
77
                </FormErrorFeedback>
84
                </FormErrorFeedback>