import React from "react"; import CancelIcon from "@mui/icons-material/Cancel"; import CheckCircleIcon from "@mui/icons-material/CheckCircle"; import { CardHeader, CardHeaderProps, FormControlLabel, Stack, Switch, Typography, } from "@mui/material"; import { useI18n } from "../contexts/I18nContext"; import { Pill } from "./Card/shared"; import Chip from "./Chip"; export interface TableCardHeaderProps extends Omit { isEditable?: boolean; isDisabled?: boolean; onChange?: (v: boolean) => void; toggled?: boolean; pills?: Pill[]; } export const TableCardHeader: React.FC = ({ title, avatar, isEditable = false, isDisabled = false, onChange, toggled, pills, ...props }) => { const { t } = useI18n(); return ( onChange?.(v)} /> } label={ {t("Edit")} } /> ) } avatar={avatar} sx={{ opacity: isDisabled && toggled ? 0.5 : 1, ...props.sx }} title={ {title} {pills?.map(({ label, color, icon }, i) => ( : )} label={label} size="small" /> ))} } /> ); }; export default TableCardHeader;