import { Switch, TableBody, TableCell, TableRow } from "@mui/material";
import { useState } from "react";
import { Grid } from "../../../../components/grid/Grid";

export const ProvinceManageUsersRowKillhouseVet = ({ row, item }) => {
  const { details } = item;

  const [checked, setChecked] = useState(details.vet.active);

  const handleChange = () => {
    setChecked(!checked);
  };

  return (
    <TableBody>
      <TableRow key={details.name}>
        <TableCell align="center">
          {details.vet.address.province.name}
        </TableCell>
        <TableCell align="center">{details.vet.address.city.name}</TableCell>
        <TableCell align="center">{details.vet.address.address}</TableCell>
        <TableCell align="center">{details.vet.identityDocuments}</TableCell>
        <TableCell align="center">{details.killHouse.name}</TableCell>
        <TableCell align="center">
          {details.vet.userBankInfo && details.vet.userBankInfo.bankName ? (
            <Grid container direction="column">
              <Grid>نام بانک: {details.vet.userBankInfo.bankName}</Grid>
              <Grid>شماره کارت: {details.vet.userBankInfo.card}</Grid>
              <Grid>شماره حساب: {details.vet.userBankInfo.account}</Grid>
              <Grid>شبا: {details.vet.userBankInfo.shaba}</Grid>
            </Grid>
          ) : (
            "-"
          )}
        </TableCell>
        <TableCell align="center">
          <Switch checked={checked} onChange={handleChange} color="primary" />
        </TableCell>
      </TableRow>
      {/* ))} */}
    </TableBody>
  );
};
