{"version":3,"file":"BookReviewLink-uExOZjfM.js","sources":["../../../app/javascript/icons/solid/photo-film.svg","../../../app/javascript/components/BookReview/MediaLink.tsx","../../../app/javascript/components/BookReview/BookReviewLink.tsx"],"sourcesContent":["import * as React from \"react\";\nconst SvgPhotoFilm = (props) => /* @__PURE__ */ React.createElement(\"svg\", { xmlns: \"http://www.w3.org/2000/svg\", viewBox: \"0 0 640 512\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { d: \"M256 0h320c35.3 0 64 28.7 64 64v224c0 35.3-28.7 64-64 64H256c-35.3 0-64-28.7-64-64V64c0-35.3 28.7-64 64-64m220 106.7C471.5 100 464 96 456 96s-15.5 4-20 10.7l-56 84-17.3-21.7c-4.6-5.7-11.5-9-18.7-9s-14.2 3.3-18.7 9l-64 80a24.01 24.01 0 0 0 18.7 39h272c8.9 0 17-4.9 21.2-12.7s3.7-17.3-1.2-24.6zM336 96a32 32 0 1 0-64 0 32 32 0 1 0 64 0M64 128h96v288c0 17.7 14.3 32 32 32h128c17.7 0 32-14.3 32-32v-32h160v64c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V192c0-35.3 28.7-64 64-64m8 64c-8.8 0-16 7.2-16 16v16c0 8.8 7.2 16 16 16h16c8.8 0 16-7.2 16-16v-16c0-8.8-7.2-16-16-16zm0 104c-8.8 0-16 7.2-16 16v16c0 8.8 7.2 16 16 16h16c8.8 0 16-7.2 16-16v-16c0-8.8-7.2-16-16-16zm0 104c-8.8 0-16 7.2-16 16v16c0 8.8 7.2 16 16 16h16c8.8 0 16-7.2 16-16v-16c0-8.8-7.2-16-16-16zm336 16v16c0 8.8 7.2 16 16 16h16c8.8 0 16-7.2 16-16v-16c0-8.8-7.2-16-16-16h-16c-8.8 0-16 7.2-16 16\" }));\nexport default SvgPhotoFilm;\n","import { Link } from \"@inertiajs/react\";\nimport Icon from \"hardcover-ui/components/Icon\";\nimport faTiktok from \"icons/brands/tiktok.svg\";\nimport faYoutube from \"icons/brands/youtube.svg\";\nimport faInstagram from \"icons/brands/instagram.svg\";\nimport faPhotoVideo from \"icons/solid/photo-film.svg\";\n\nexport interface MediaLinkProps {\n url: string;\n}\n\nconst iconForUrl = (url): any => {\n try {\n const parsedUrl = new URL(url);\n\n if (parsedUrl.host.indexOf(\"youtube\") !== -1) {\n return faYoutube;\n }\n if (parsedUrl.host.indexOf(\"tiktok\") !== -1) {\n return faTiktok;\n }\n if (parsedUrl.host.indexOf(\"instagram\") !== -1) {\n return faInstagram;\n }\n return faPhotoVideo;\n } catch {\n return faPhotoVideo;\n }\n};\n\nconst MediaLink = ({ url }: MediaLinkProps) => {\n const icon = iconForUrl(url);\n\n return (\n \n
\n Originally posted at{\" \"}\n \n {displayUrl}\n \n .\n {userBook.mediaUrl && (\n \n