github.com/minio/console@v1.4.1/web-app/src/screens/Console/Buckets/ListBuckets/Objects/ObjectDetails/SpecificVersionPill.tsx (about) 1 // This file is part of MinIO Console Server 2 // Copyright (c) 2022 MinIO, Inc. 3 // 4 // This program is free software: you can redistribute it and/or modify 5 // it under the terms of the GNU Affero General Public License as published by 6 // the Free Software Foundation, either version 3 of the License, or 7 // (at your option) any later version. 8 // 9 // This program is distributed in the hope that it will be useful, 10 // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 // GNU Affero General Public License for more details. 13 // 14 // You should have received a copy of the GNU Affero General Public License 15 // along with this program. If not, see <http://www.gnu.org/licenses/>. 16 17 import React from "react"; 18 19 interface ISpecificVersionPillProps { 20 type: "null" | "current" | "deleted"; 21 } 22 23 const SpecificVersionPill = ({ type }: ISpecificVersionPillProps) => { 24 let bgColor = "#000"; 25 let message = ""; 26 27 switch (type) { 28 case "null": 29 bgColor = "#07193E"; 30 message = "NULL VERSION"; 31 break; 32 case "deleted": 33 bgColor = "#868686"; 34 message = "DELETED"; 35 break; 36 default: 37 bgColor = "#174551"; 38 message = "CURRENT VERSION"; 39 } 40 41 return ( 42 <span 43 style={{ 44 backgroundColor: bgColor, 45 padding: "0 5px", 46 display: "inline-block", 47 color: "#FFF", 48 fontWeight: "bold", 49 fontSize: 12, 50 borderRadius: 2, 51 whiteSpace: "nowrap", 52 margin: "0 10px", 53 }} 54 > 55 {message} 56 </span> 57 ); 58 }; 59 60 export default SpecificVersionPill;