webapp/components/dashboard/seller/new/index.js

import React from 'react';
import {Helmet} from 'react-helmet';
import PropTypes from 'prop-types';
import {Switch, Route, Redirect} from 'react-router-dom';
import RouteWithProps from '/common/components/routeWithProps';
import NotFound from '/components/NotFound';

/**
 * This Component renders a formik form for adding Property with basic details.
 * @param {object} props props
 * @return {ReactElement} React component
 */
function Listing(props) {
	const {user} = props;
	return (
		<>
			<Helmet>
				<title>
					Dash: List Property
				</title>
			</Helmet>
			<Switch>
				<Route component={() => <Redirect to='/dashboard/seller/listing/new'/>} exact path='/dashboard/seller/listing'/>
				<RouteWithProps component={require('./pages').default} path='/dashboard/seller/listing/:rawUnitId' user={user}/>
				<RouteWithProps component={NotFound}/>
			</Switch>
		</>
	);
}
Listing.propTypes = {
	user: PropTypes.object,
};

export default Listing;