| 1 | import { useSelector } from "react-redux"; |
| 2 | import { RootState } from "../../redux/store"; |
| 3 | import styled from "styled-components"; |
| 4 | import { PlayIcon } from "@heroicons/react/24/outline"; |
| 5 | |
| 6 | const DEFAULT_SIZE = "28px"; |
| 7 | |
| 8 | const FlashingDiv = styled.div` |
| 9 | margin-top: 16px; |
| 10 | margin: auto; |
| 11 | width: ${DEFAULT_SIZE}; |
| 12 | animation: flash 1.2s infinite ease-in-out; |
| 13 | @keyframes flash { |
| 14 | 0% { |
| 15 | opacity: 0.4; |
| 16 | } |
| 17 | 50% { |
| 18 | opacity: 1; |
| 19 | } |
| 20 | 100% { |
| 21 | opacity: 0.4; |
| 22 | } |
| 23 | } |
| 24 | `; |
| 25 | |
| 26 | function Loader(props: { size?: string }) { |
| 27 | const vscMediaUrl = window.vscMediaUrl; |
| 28 | return ( |
| 29 | <FlashingDiv> |
| 30 | {vscMediaUrl ? ( |
| 31 | <img src={`${vscMediaUrl}/play_button.png`} width="22px" /> |
| 32 | ) : ( |
| 33 | <PlayIcon width={props.size || DEFAULT_SIZE} /> |
| 34 | )} |
| 35 | </FlashingDiv> |
| 36 | ); |
| 37 | } |
| 38 | |
| 39 | export default Loader; |