import React from "react"; import { SxProps } from "@mui/material"; import Box from "@mui/material/Box"; import ButtonBase from "@mui/material/ButtonBase"; import { styled } from "@mui/material/styles"; import Typography from "@mui/material/Typography"; import Stack from "@mui/system/Stack"; import { LogoType } from "../../types"; import Brand from "../Brand"; interface BrandingProps { logo?: LogoType; title?: string; subtitle?: string; version?: string; onClick?: React.MouseEventHandler; fullWidth?: boolean; sx?: SxProps; } interface BrandingOwnerState extends Pick {} const BrandingRoot = styled(Box, { name: "BananasNavRail", slot: "Branding", })<{ ownerState: BrandingOwnerState }>(({ theme, ownerState }) => theme.unstable_sx({ display: "flex", flexDirection: "row", alignItems: "center", flexGrow: 1, width: ownerState.fullWidth ? "100%" : "0", }), ); const StyledBrandBox = styled(Box, { name: "BananasNavRail", slot: "BrandBox", })(({ theme }) => theme.unstable_sx({ minWidth: "100%", height: "100%", aspectRatio: "1 / 1", bgcolor: "rgba(0, 0, 0, 0.5)", display: "flex", alignItems: "center", p: 1.5, borderRadius: 3, "&:hover": { bgcolor: "rgba(0, 0, 0, 0.25)", }, '&:hover [class$="brandIconBox"]': { transform: "scale(1.1)", }, transition: theme.transitions.create(["background-color"], { duration: theme.transitions.duration.shortest, }), }), ); const StyledBrandIconBox = styled(Box, { name: "BananasNavRail", slot: "BrandIconBox", })(({ theme }) => theme.unstable_sx({ width: "100%", transition: theme.transitions.create(["transform"], { duration: theme.transitions.duration.shortest, }), }), ); const Branding: React.FC = ({ logo, title, subtitle, version, onClick, fullWidth, sx, }) => { const ownerState = { fullWidth }; return ( {logo ? ( ) : ( {title} )} *": { textAlign: "left", fontSize: "0.75rem", display: "block", lineHeight: `1em`, }, }} > {subtitle} {version} ); }; export default Branding;