import { parse as parseQs } from "qs"; import React from "react"; import { useIntl } from "react-intl"; import { Route, RouteComponentProps, Switch } from "react-router-dom"; import { sectionNames } from "@saleor/intl"; import { WindowTitle } from "../components/WindowTitle"; import { serviceAddPath, serviceListPath, ServiceListUrlQueryParams, servicePath, ServiceUrlQueryParams } from "./urls"; import ServiceCreate from "./views/ServiceCreate"; import ServiceDetailsComponent from "./views/ServiceDetails"; import ServiceListComponent from "./views/ServiceList"; const ServiceList: React.FC = ({ location }) => { const qs = parseQs(location.search.substr(1)); const params: ServiceListUrlQueryParams = qs; return ; }; interface ServiceDetailsProps extends RouteComponentProps<{ id: string }> { token: string; onTokenClose: () => void; } const ServiceDetails: React.FC = ({ match, token, onTokenClose }) => { const qs = parseQs(location.search.substr(1)); const params: ServiceUrlQueryParams = qs; return ( ); }; const ServiceSection = () => { const intl = useIntl(); const [token, setToken] = React.useState(null); return ( <> } /> ( setToken(null)} /> )} /> ); }; export default ServiceSection;