Advertisement
ikamal7

LocationNew.js

Jun 7th, 2023
1,071
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import React from 'react';
  2. import {UsaStates} from "usa-states";
  3. import GenerateFormComponent from "@/components/Booking/GenerateFormComponent";
  4. import withForm from "@/components/Booking/withForm";
  5.  
  6. const LocationNew = ({ handleFieldChange }) => {
  7.     const usStates = new UsaStates({includeTerritories: true});
  8.     const statesNames = usStates.arrayOf('names');
  9.     const fields = [
  10.         {
  11.             id: 'address',
  12.             label: 'Street Address',
  13.             type: 'text',
  14.             placeholder: 'Enter your address',
  15.             value: '',
  16.         },
  17.         {
  18.             id: 'city',
  19.             label: 'City',
  20.             type: 'text',
  21.             placeholder: 'Enter your City',
  22.             value: '',
  23.         },
  24.         {
  25.             id: 'province',
  26.             label: 'Province',
  27.             type: 'select',
  28.             options: [
  29.                 'Select Province',
  30.                 ...statesNames.map((state) => state),
  31.             ],
  32.             value: '',
  33.         },
  34.         {
  35.             id: 'zip',
  36.             label: 'Zip Code',
  37.             type: 'text',
  38.             placeholder: '',
  39.             value: '',
  40.         },
  41.         {
  42.             id: 'unit',
  43.             label: 'Unit #',
  44.             type: 'text',
  45.             placeholder: '',
  46.             value: '',
  47.         },
  48.         {
  49.             id: 'propertySize',
  50.             label: 'Property Size (with Basement)',
  51.             type: 'select',
  52.             options: [
  53.                 '0-999 sq ft',
  54.                 '1000-2000 sq ft',
  55.                 '2000-3000 sq ft',
  56.                 '4000-5000 sq ft',
  57.                 '5000+ sq ft',
  58.                 "Don't know!",
  59.             ],
  60.             value: '0-999 sq ft',
  61.         },
  62.         {
  63.             id: 'footageType',
  64.             label: 'Please include the TOTAL SQUARE FOOTAGE WITH BASEMENT in the "Property Size" field *',
  65.             type: 'checkbox',
  66.             extraLabel: 'If you want any footage or floorplans of the basement, otherwise it will not be captured.',
  67.             options: [
  68.                 {
  69.                     label: 'Yes, the above square footage is the total including basement',
  70.                     value: 'total_with_basement',
  71.                 },
  72.                 {
  73.                     label: 'Please skip the basement - I do not need any media or floorplans for it',
  74.                     value: 'skip_basement',
  75.                 },
  76.                 {
  77.                     label: 'There is no basement at this property',
  78.                     value: 'no_basement',
  79.                 },
  80.                 {
  81.                     label: "I'm not sure about the total. Charge me based on final captured sq ft",
  82.                     value: 'charge_based_on_sqft',
  83.                 },
  84.             ],
  85.             value: ['total_with_basement'],
  86.         },
  87.         {
  88.             id: 'find',
  89.             label: 'How did you find out about us?',
  90.             type: 'select',
  91.             options: [
  92.                 'Loyal Client',
  93.                 'Google Search',
  94.                 'Social Media',
  95.                 'Email',
  96.                 'Referral',
  97.                 'Tradeshow',
  98.             ],
  99.             value: 'Social Media',
  100.         },
  101.         {
  102.             id: 'propertyType',
  103.             label: 'Select Property Type',
  104.             type: 'select',
  105.             options: [
  106.                 'House',
  107.                 'Condominium',
  108.                 'Townhouse',
  109.                 'Lot',
  110.                 'Multi-Unit',
  111.                 'Commercial',
  112.                 'Mixed-Use',
  113.                 'Other',
  114.             ],
  115.             value: '',
  116.         },
  117.         {
  118.             id: 'propertyCondition',
  119.             label: 'Condition of the Property',
  120.             type: 'select',
  121.             options: [
  122.                 '100% Ready',
  123.                 'Under Construction',
  124.                 'Vacant',
  125.                 'Tenant Property',
  126.                 'New Construction',
  127.             ],
  128.             value: '',
  129.         },
  130.         {
  131.             id: 'access',
  132.             label: 'Access?',
  133.             type: 'select',
  134.             options: [
  135.                 'Realtor will be on site',
  136.                 'Owner will be on site',
  137.                 'Lockbox (please provide the code)',
  138.                 'Other',
  139.             ],
  140.             value: '',
  141.         },
  142.         {
  143.             id: 'luckBox',
  144.             label: 'Lockbox?',
  145.             type: 'text',
  146.             placeholder: '',
  147.             value: '',
  148.         },
  149.         {
  150.             id: 'customerCode',
  151.             label: 'Customer Code (Optional)',
  152.             type: 'text',
  153.             placeholder: '',
  154.             value: '',
  155.         },
  156.         {
  157.             id: 'specialRequest',
  158.             label: 'Special Requests',
  159.             type: 'textarea',
  160.             placeholder: 'Areas for the photographer to focus on or avoid. Parking instructions. Etc.',
  161.             value: '',
  162.         },
  163.     ];
  164.  
  165.  
  166.     return (
  167.         <div>
  168.             <GenerateFormComponent
  169.                 fields={fields}
  170.                 handleFieldChange={handleFieldChange}
  171.             />
  172.         </div>
  173.     );
  174. };
  175.  
  176.  
  177. export default withForm(LocationNew);
  178.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement