import {
    Box,
    Table,
    TableBody,
    TableCell,
    TableContainer,
    TableHead,
    TableRow,
} from "@mui/material";
import {useTranslations} from "next-intl";
import moment from "jalali-moment";

const TableContent = ({row}) => {
    const t = useTranslations();
    return (<Box>
            <TableContainer sx={{maxHeight: 600}}>
                <Table stickyHeader sx={{minWidth: 800}}>
                    <TableHead>
                        <TableRow>
                            <TableCell>{t("LoanHistory.Table_head_date")}</TableCell>
                            <TableCell>{t("LoanHistory.Table_head_state")}</TableCell>
                            <TableCell>{t("LoanHistory.Table_head_refer_reason")}</TableCell>
                        </TableRow>
                    </TableHead>
                    <TableBody>
                        <TableRow sx={{'&:last-child td, &:last-child th': {border: 0}}}>
                            <TableCell>{moment(row.original.latest_history.created_at).locale("fa").format("HH:mm | yyyy/MM/DD")}</TableCell>
                            <TableCell>{row.original.latest_history.previous_state_name}</TableCell>
                            <TableCell>{row.original.latest_history.expert_description}</TableCell>
                        </TableRow>
                    </TableBody>
                </Table>
            </TableContainer>
        </Box>

    )
}
export default TableContent