import React, { useState } from 'react'; import { Banner, Modal, Select, Input } from '@douyinfe/semi-ui'; import { transform } from '../../../../../services/transformer/providerTransformer'; import { useSelector } from 'react-redux'; import { IconLikeHeart } from '@douyinfe/semi-icons'; import './ProviderMutator.less'; const sortProvider = (a, b) => { if (a.key < b.key) { return -1; } if (a.key > b.key) { return 1; } return 0; }; export default function ProviderMutator({ onVisibilityChanged, visible = false, onData } = {}) { const provider = useSelector((state) => state.provider); const [selectedProvider, setSelectedProvider] = useState(null); const [providerUrl, setProviderUrl] = useState(null); const [validationMessage, setValidationMessage] = useState(null); const validate = () => { if (selectedProvider == null || selectedProvider.length === 0 || providerUrl == null || providerUrl.length === 0) { return 'Please select a provider and copy the browser url into the textfield after configuring your search parameter.'; } try { const url = new URL(providerUrl); if (selectedProvider.baseUrl.indexOf(url.origin) === -1) { return 'The url you have copied is not valid.'; } /* eslint-disable no-unused-vars */ } catch (ignored) { return 'The url you have copied is not valid.'; } return null; }; const onSubmit = (doStore) => { if (doStore) { const validationResult = validate(); if (validationResult == null) { onData( transform({ url: providerUrl, id: selectedProvider.id, name: selectedProvider.name, }), ); setProviderUrl(null); setSelectedProvider(null); onVisibilityChanged(false); } else { setValidationMessage(validationResult); } } else { setProviderUrl(null); setSelectedProvider(null); onVisibilityChanged(false); } }; return ( onSubmit(true)} onCancel={() => onSubmit(false)} style={{ width: '50rem' }} okText="Save" > {validationMessage != null && ( Error} style={{ marginBottom: '1rem' }} description={validationMessage} /> )}

Provider are the of Fredy. We're supporting multiple Provider such as Immowelt, Kalaydo etc. Select a provider from the list below.
Fredy will then open the provider's url in a new tab.

You will need to configure your search parameter like you would do when you do a regular search on the provider's website.
When the search results are shown on the website, copy the url and paste it into the textfield below.

Warning} style={{ marginBottom: '1rem' }} description={

Currently, our Immoscout implementation does not support drawing shapes on a map. Use a radius instead.

} /> { setProviderUrl(e.target.value); }} />
); }