12345678910111213141516171819
  1. import React from 'react';
  2. import { useSearchParams } from 'react-router-dom';
  3. export default function PreviewObj(props) {
  4. const [ searchParams ] = useSearchParams();
  5. const url = decodeURIComponent(searchParams.get('url'));
  6. const type = decodeURIComponent(searchParams.get('type'));
  7. return (
  8. <object
  9. data={url}
  10. type={type}
  11. width="100%"
  12. height="100%"
  13. />
  14. );
  15. }