github.com/minio/console@v1.4.1/web-app/src/screens/Console/Buckets/BucketDetails/SummaryItems/LabelWithIcon.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 import { Box } from "mds"; 19 20 type LabelWithIconProps = { 21 icon: React.ReactNode | null; 22 label: React.ReactNode | null; 23 }; 24 25 const LabelWithIcon = ({ icon = null, label = null }: LabelWithIconProps) => { 26 return ( 27 <Box 28 sx={{ 29 display: "flex", 30 alignItems: "center", 31 gap: 5, 32 marginTop: 3, 33 }} 34 > 35 <Box 36 sx={{ 37 height: 16, 38 width: 16, 39 display: "flex", 40 alignItems: "center", 41 }} 42 > 43 {icon} 44 </Box> 45 <Box>{label}</Box> 46 </Box> 47 ); 48 }; 49 50 export default LabelWithIcon;