/**
=========================================================
* Material Dashboard 2 PRO React TS - v1.0.0
=========================================================
* Product Page: https://www.creative-tim.com/product/material-dashboard-2-pro-react-ts
* Copyright 2022 Creative Tim (https://www.creative-tim.com)
Coded by www.creative-tim.com
=========================================================
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*/
// react-router-dom components
import { Link } from "react-router-dom";
// @mui material components
import Card from "@mui/material/Card";
import CardMedia from "@mui/material/CardMedia";
import Tooltip from "@mui/material/Tooltip";
// Material Dashboard 2 PRO React TS components
import MDBox from "components/MDBox";
import MDTypography from "components/MDTypography";
import MDButton from "components/MDButton";
import MDAvatar from "components/MDAvatar";
// Declaring props types for DefaultProjectCard
interface Props {
image: string;
label: string;
title: string;
description: string;
action: {
type: "external" | "internal";
route: string;
color:
| "primary"
| "secondary"
| "info"
| "success"
| "warning"
| "error"
| "light"
| "dark"
| "white";
label: string;
};
authors?: {
image: string;
name: string;
}[];
[key: string]: any;
}
function DefaultProjectCard({
image,
label,
title,
description,
action,
authors,
}: Props): JSX.Element {
const renderAuthors = authors.map(({ image: media, name }) => (
({
border: `${borderWidth[2]} solid ${white.main}`,
cursor: "pointer",
position: "relative",
ml: -1.25,
"&:hover, &:focus": {
zIndex: "10",
},
})}
/>
));
return (
md,
objectFit: "cover",
objectPosition: "center",
}}
/>
{label}
{action.type === "internal" ? (
{title}
) : (
{title}
)}
{description}
{action.type === "internal" ? (
{action.label}
) : (
{action.label}
)}
{renderAuthors}
);
}
// Declaring default props for DefaultProjectCard
DefaultProjectCard.defaultProps = {
authors: [],
};
export default DefaultProjectCard;