React mui card

241 阅读1分钟
import React from 'react'
import Box from "@mui/material/Box";
import Paper from "@mui/material/Paper";
import Grid from "@mui/material/Grid";
import Link from "@mui/material/Link";
import Card from "@mui/material/Card";
import CardContent from "@mui/material/CardContent";

import Breadcrumbs from "@mui/material/Breadcrumbs";
import Typography from "@mui/material/Typography";


function Cars(props){
  return(
    <Grid container item xs={12} sm={6} md={4}>
              <Card
                sx={{
                  border: "1px solid #eee",
                  height: "110px",
                  width: "280px",
                  minWidth: "260px",
                  margin: "5px",
                  '&:hover':{backgroundColor:'#efefef'}
                }}
              >
                <Box sx={{ display: "flex", flexDirection: "column" }}>
                  <CardContent sx={{ display: "flex" }}>
                    <Box sx={{minWidth:'30px',minHeight:'30px'}}>
                    {props.item.img}
                    </Box>
                    <Typography component="div">
                      <div style={{ fontWeight: "700", padding: "0 10px" }}>
                      {props.item.text}
                      </div>
                      <div style={{ padding: "3px 10px", fontSize: "14px" }}>
                      {props.item.tip}
                      </div>
                    </Typography>
                    <svg
                      viewBox="0 0 24 24"
                      xmlns="http://www.w3.org/2000/svg"
                      fill="currentColor"
                      width="32"
                      height="32"
                    >
                      <path d="M9 7L10 6L16 12L10 18L9 17L14.17 12L9 7Z"></path>
                    </svg>
                  </CardContent>
                </Box>
              </Card>
            </Grid>
  )
}
export default function Cardnumber() {
  const alist=[
      {
        img: [
          <svg
            viewBox="0 0 24 24"
            fill="none"
            xmlns="http://www.w3.org/2000/svg"
          >
            <path
              d="M0 4C0 1.79086 1.79086 0 4 0H20C22.2091 0 24 1.79086 24 4V20C24 22.2091 22.2091 24 20 24H4C1.79086 24 0 22.2091 0 20V4Z"
              fill="#F23030"
            ></path>
            <path
              d="M5.68718 5.68718L11.8787 7.23507L12 7.26539L12.1213 7.23507L18.3128 5.68718L16.7649 11.8787L16.7346 12L16.7649 12.1213L18.3128 18.3128L12.1213 16.7649L12 16.7346L11.8787 16.7649L5.68718 18.3128L7.23507 12.1213L7.26539 12L7.23507 11.8787L5.68718 5.68718Z"
              stroke="white"
            ></path>
          </svg>,
        ],
        fill: "#F23030",
        text: "压缩PDF",
        newItem: false,
        tip: "缩减PDF文档的大小,且不牺牲文档质量",
      },
      {
        img: [
          <svg
            viewBox="0 0 24 24"
            fill="none"
            xmlns="http://www.w3.org/2000/svg"
          >
            <path
              d="M0 4C0 1.79086 1.79086 0 4 0H20C22.2091 0 24 1.79086 24 4V20C24 22.2091 22.2091 24 20 24H4C1.79086 24 0 22.2091 0 20V4Z"
              fill="#3D99F5"
            ></path>
            <path d="M10.5 15.5H5.5V5.5H13.5V8.5" stroke="white"></path>
            <rect
              x="10.5"
              y="8.5"
              width="8"
              height="10"
              stroke="white"
            ></rect>
            <path d="M12 15.5H17" stroke="white"></path>
            <path d="M12 13.5H17" stroke="white"></path>
            <path d="M12 11.5H17" stroke="white"></path>
          </svg>,
        ],
        fill: "#3D99F5",
        text: "PDF转Word",
        newItem: false,
        tip: "把PDF文档转换为可编辑的Word文档",
      },
      {
        img: [
          <svg
            viewBox="0 0 24 24"
            fill="none"
            xmlns="http://www.w3.org/2000/svg"
          >
            <path
              d="M0 4C0 1.79086 1.79086 0 4 0H20C22.2091 0 24 1.79086 24 4V20C24 22.2091 22.2091 24 20 24H4C1.79086 24 0 22.2091 0 20V4Z"
              fill="#00CC44"
            ></path>
            <path d="M10.5 15.5H5.5V5.5H13.5V8.5" stroke="white"></path>
            <rect
              x="10.5"
              y="8.5"
              width="8"
              height="10"
              stroke="white"
            ></rect>
            <path d="M12.5 12.5H16.5V16.5H12.5V12.5Z" stroke="white"></path>
            <path d="M12.5 14.5H16.5" stroke="white"></path>
            <path d="M14.5 12.5V16.5" stroke="white"></path>
          </svg>,
        ],
        fill: "#00CC44",
        text: "PDF转Excel",
        newItem: false,
        tip: "把PDF文档转换为可编辑的Excel文档",
      },
      {
        img: [
          <svg
            viewBox="0 0 24 24"
            fill="none"
            xmlns="http://www.w3.org/2000/svg"
          >
            <path
              d="M0 4C0 1.79086 1.79086 0 4 0H20C22.2091 0 24 1.79086 24 4V20C24 22.2091 22.2091 24 20 24H4C1.79086 24 0 22.2091 0 20V4Z"
              fill="#FF8000"
            ></path>
            <path d="M10.5 15.5H5.5V5.5H13.5V8.5" stroke="white"></path>
            <rect
              x="10.5"
              y="8.5"
              width="8"
              height="10"
              stroke="white"
            ></rect>
            <path
              d="M16 14C16 15.1046 15.1046 16 14 16C12.8954 16 12 15.1046 12 14C12 12.8954 12.8954 12 14 12V14H16Z"
              fill="white"
            ></path>
            <path
              d="M15 11C16.1046 11 17 11.8954 17 13H15V11Z"
              fill="white"
            ></path>
          </svg>,
        ],
        fill: "#FF8000",
        text: "PDF转PPT",
        newItem: false,
        tip: "把PDF文档转换为可编辑的PowerPoint幻灯片",
      },
      {
        img: [
          <svg
            viewBox="0 0 24 24"
            fill="none"
            xmlns="http://www.w3.org/2000/svg"
          >
            <path
              d="M0 4C0 1.79086 1.79086 0 4 0H20C22.2091 0 24 1.79086 24 4V20C24 22.2091 22.2091 24 20 24H4C1.79086 24 0 22.2091 0 20V4Z"
              fill="#FFB700"
            ></path>
            <path d="M10.5 15.5H5.5V5.5H13.5V8.5" stroke="white"></path>
            <rect
              x="10.5"
              y="8.5"
              width="8"
              height="10"
              stroke="white"
            ></rect>
            <path
              d="M10.5 15.5L12 14L14.5 16.5L16 15L18.5 17.5"
              stroke="white"
            ></path>
            <circle
              cx="16"
              cy="11"
              r="0.5"
              fill="white"
              stroke="white"
            ></circle>
          </svg>,
        ],
        fill: "#FFB700",
        text: "PDF转JPG",
        newItem: false,
        tip: "从PDF文档提取图像,或将每一页分别储存为不同的文档",
      },
    
      {
        img: [
          <svg
            viewBox="0 0 24 24"
            fill="none"
            xmlns="http://www.w3.org/2000/svg"
          >
            <path
              d="M0 4C0 1.79086 1.79086 0 4 0H20C22.2091 0 24 1.79086 24 4V20C24 22.2091 22.2091 24 20 24H4C1.79086 24 0 22.2091 0 20V4Z"
              fill="#3D99F5"
            ></path>
            <rect x="5.5" y="5.5" width="8" height="10" stroke="white"></rect>
            <path d="M14 8.5H18.5V18.5001H10.5V15.5001" stroke="white"></path>
            <path d="M7 12.5H12" stroke="white"></path>
            <path d="M7 10.5H12" stroke="white"></path>
            <path d="M7 8.5H12" stroke="white"></path>
          </svg>,
        ],
        fill: "#3D99F5",
        text: "Word转PDF",
        newItem: false,
        tip: "把Word文档转换为PDF文档",
      },
      {
        img: [
          <svg
            viewBox="0 0 24 24"
            fill="none"
            xmlns="http://www.w3.org/2000/svg"
          >
            <path
              d="M0 4C0 1.79086 1.79086 0 4 0H20C22.2091 0 24 1.79086 24 4V20C24 22.2091 22.2091 24 20 24H4C1.79086 24 0 22.2091 0 20V4Z"
              fill="#00CC44"
            ></path>
            <rect x="5.5" y="5.5" width="8" height="10" stroke="white"></rect>
            <path d="M7.5 9.5H11.5V13.5H7.5V9.5Z" stroke="white"></path>
            <path d="M7.5 11.5H11.5" stroke="white"></path>
            <path d="M9.5 9.5V13.5" stroke="white"></path>
            <path d="M14 8.5H18.5V18.5001H10.5V15.5001" stroke="white"></path>
          </svg>,
        ],
        fill: "#00CC44",
        text: "Excel转PDF",
        newItem: false,
        tip: "把Excel文档转换为PDF文档",
      },
      {
        img: [
          <svg
            viewBox="0 0 24 24"
            fill="none"
            xmlns="http://www.w3.org/2000/svg"
          >
            <path
              d="M0 4C0 1.79086 1.79086 0 4 0H20C22.2091 0 24 1.79086 24 4V20C24 22.2091 22.2091 24 20 24H4C1.79086 24 0 22.2091 0 20V4Z"
              fill="#FF8000"
            ></path>
            <rect x="5.5" y="5.5" width="8" height="10" stroke="white"></rect>
            <path
              d="M11 11C11 12.1046 10.1046 13 9 13C7.89543 13 7 12.1046 7 11C7 9.89543 7.89543 9 9 9V11H11Z"
              fill="white"
            ></path>
            <path
              d="M10 8C11.1046 8 12 8.89543 12 10H10V8Z"
              fill="white"
            ></path>
            <path d="M14 8.5H18.5V18.5001H10.5V15.5001" stroke="white"></path>
          </svg>,
        ],
        fill: "#FF8000",
        text: "PPT转PDF",
        newItem: false,
        tip: "把PowerPoint幻灯片转换为PDF文档",
      },
      {
        img: [
          <svg
            viewBox="0 0 24 24"
            fill="none"
            xmlns="http://www.w3.org/2000/svg"
          >
            <path
              d="M0 4C0 1.79086 1.79086 0 4 0H20C22.2091 0 24 1.79086 24 4V20C24 22.2091 22.2091 24 20 24H4C1.79086 24 0 22.2091 0 20V4Z"
              fill="#FFB700"
            ></path>
            <rect x="5.5" y="5.5" width="8" height="10" stroke="white"></rect>
            <path
              d="M5.5 12.5L7 11L9.5 13.5L11 12L13.5 14.5"
              stroke="white"
            ></path>
            <circle
              cx="11"
              cy="8"
              r="0.5"
              fill="white"
              stroke="white"
            ></circle>
            <path d="M14 8.5H18.5V18.5001H10.5V15.5001" stroke="white"></path>
          </svg>,
        ],
        fill: "#FFB700",
        text: "JPG转PDF",
        newItem: false,
        tip: "把JPG、PNG、BMP、GIF、TIFF图像转换为PDF文档",
      },
    ]
    return (
        <div>
          <Box sx={{ flexGrow: 1 }} sx={{ margin: "auto", maxWidth: "900px" }}>
          <Grid container spacing={1}>
            {alist.map((item, index) => (
        <Cars key={index} item={item} />
         ))}
          </Grid>
          </Box>
        </div>
    )
}