import * as React from "react"; import { Card, CardHeader, CardContent, SxProps, Theme, Tabs, Tab, Box, Typography, Grid, Link, } from "@mui/material"; import { DataGrid, GridColDef } from "@mui/x-data-grid"; import { darken, lighten, styled } from "@mui/material/styles"; import { ThemeProvider } from "@emotion/react"; import { TAB_THEME } from "@/theme/colorConst"; import AllProjectGrid from "../UserWorkspacePage/ProjectGrid"; interface AssignedProjectGridProps { Title?: string; // rows: any[]; // columns: any[]; columnWidth?: number; Style?: boolean; sx?: SxProps; height?: number; [key: string]: any; } interface TabPanelProps { children?: React.ReactNode; index: number; value: number; } function CustomTabPanel(props: TabPanelProps) { const { children, value, index, ...other } = props; return ( ); } function a11yProps(index: number) { return { id: `simple-tab-${index}`, "aria-controls": `simple-tabpanel-${index}`, }; } const AssignedProjectGrid: React.FC = ({ Title, rows, columns, columnWidth, Style = true, sx, height, ...props }) => { // const modifiedColumns = columns.map((column) => { // return { // ...column, // width: columnWidth ?? 150, // }; // }); // const rowsWithDefaultValues = rows.map((row) => { // return { ...row }; // }); const getBackgroundColor = (color: string, mode: "light" | "dark") => mode === "dark" ? darken(color, 0.7) : lighten(color, 0.7); const getHoverBackgroundColor = (color: string, mode: "light" | "dark") => mode === "dark" ? darken(color, 0.6) : lighten(color, 0.6); const getSelectedBackgroundColor = (color: string, mode: "light" | "dark") => mode === "dark" ? darken(color, 0.5) : lighten(color, 0.5); const getSelectedHoverBackgroundColor = ( color: string, mode: "light" | "dark", ) => (mode === "dark" ? darken(color, 0.4) : lighten(color, 0.4)); const StyledDataGrid = styled(DataGrid)(({ theme }) => ({ "& .super-app-theme--Open": { backgroundColor: getBackgroundColor( theme.palette.info.main, theme.palette.mode, ), "&:hover": { backgroundColor: getHoverBackgroundColor( theme.palette.info.main, theme.palette.mode, ), }, "&.Mui-selected": { backgroundColor: getSelectedBackgroundColor( theme.palette.info.main, theme.palette.mode, ), "&:hover": { backgroundColor: getSelectedHoverBackgroundColor( theme.palette.info.main, theme.palette.mode, ), }, }, }, "& .super-app-theme--finish": { backgroundColor: getBackgroundColor( theme.palette.success.main, theme.palette.mode, ), "&:hover": { backgroundColor: getHoverBackgroundColor( theme.palette.success.main, theme.palette.mode, ), }, "&.Mui-selected": { backgroundColor: getSelectedBackgroundColor( theme.palette.success.main, theme.palette.mode, ), "&:hover": { backgroundColor: getSelectedHoverBackgroundColor( theme.palette.success.main, theme.palette.mode, ), }, }, }, "& .super-app-theme--danger": { backgroundColor: getBackgroundColor( theme.palette.warning.main, theme.palette.mode, ), "&:hover": { backgroundColor: getHoverBackgroundColor( theme.palette.warning.main, theme.palette.mode, ), }, "&.Mui-selected": { backgroundColor: getSelectedBackgroundColor( theme.palette.warning.main, theme.palette.mode, ), "&:hover": { backgroundColor: getSelectedHoverBackgroundColor( theme.palette.warning.main, theme.palette.mode, ), }, }, }, "& .super-app-theme--warning": { backgroundColor: getBackgroundColor( theme.palette.error.main, theme.palette.mode, ), "&:hover": { backgroundColor: getHoverBackgroundColor( theme.palette.error.main, theme.palette.mode, ), }, "&.Mui-selected": { backgroundColor: getSelectedBackgroundColor( theme.palette.error.main, theme.palette.mode, ), "&:hover": { backgroundColor: getSelectedHoverBackgroundColor( theme.palette.error.main, theme.palette.mode, ), }, }, }, })); const [value, setValue] = React.useState(0); const handleChange = (event: React.SyntheticEvent, newValue: number) => { setValue(newValue); }; return (
{Title && }
{/* Item {value} Item {value} Item {value} */}
); }; export default AssignedProjectGrid;