All files / publisher/listing/components/ContactInformation ContactInformation.tsx

100% Statements 1/1
100% Branches 0/0
100% Functions 1/1
100% Lines 1/1

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84                                                        5x                                                                                                              
import {
  Control,
  UseFormRegister,
  FieldValues,
  UseFormGetFieldState,
  UseFormGetValues,
} from "react-hook-form";
 
import PrimaryDomainInput from "./PrimaryDomainInput";
import ContactFields from "./ContactFields";
 
import type { Data } from "../../types";
 
type Props = {
  data: Data;
  register: UseFormRegister<FieldValues>;
  control: Control<FieldValues>;
  getFieldState: UseFormGetFieldState<FieldValues>;
  getValues: UseFormGetValues<FieldValues>;
};
 
function ContactInformation({
  data,
  register,
  control,
  getFieldState,
  getValues,
}: Props): JSX.Element {
  return (
    <>
      <h2 className="p-heading--4">Contact information</h2>
 
      <PrimaryDomainInput
        data={data}
        register={register}
        getFieldState={getFieldState}
        getValues={getValues}
      />
 
      <ContactFields
        register={register}
        control={control}
        labelName="Other websites"
        fieldName="websites"
        getValues={getValues}
      />
 
      <ContactFields
        register={register}
        control={control}
        labelName="Contacts"
        fieldName="contacts"
        getValues={getValues}
      />
 
      <ContactFields
        register={register}
        control={control}
        labelName="Donations"
        fieldName="donations"
        getValues={getValues}
      />
 
      <ContactFields
        register={register}
        control={control}
        labelName="Source code"
        fieldName="source_code"
        getValues={getValues}
      />
 
      <ContactFields
        register={register}
        control={control}
        labelName="Issues"
        fieldName="issues"
        getValues={getValues}
      />
    </>
  );
}
 
export default ContactInformation;