"use client";

import React, { useContext } from "react";
import { BottomSheet } from "react-spring-bottom-sheet";
import AppContext from "@ctx/AppContext";
import Buttonbriz from "plugins/Buttonbriz/page";

const BottomSheetChangeRole = (props) => {
  const CTX = useContext(AppContext);

  const roles = CTX.state.profile.roles;

  return (
    <BottomSheet
      open={CTX.state.BottomSheetChangeRoleOpen}
      onDismiss={() => CTX.setBottomSheetChangeRoleOpen(false)}
      blocking={false}
    >
      <div className="text-center py-2 bg-primary-300  ">
        <p className="mb-0 text-white relative top-[-5px]">انتخاب نقش جدید </p>
      </div>

      <div className="bg-body-100 p-3 ">
        {roles?.map((e) => (
          <div className="bg-gray-100 rounded-xl border-[1px] border-gray-200 p-5 m-2">
            <p className="mb-0 text-right">{e.roleName}</p>
          </div>
        ))}
        <Buttonbriz
          title="ثبت نقش"
          color="PRIMARY"
          icon="CHECK"
          // buttonEvent={() => handleCreateRoutine()}
        />
      </div>
    </BottomSheet>
  );
};

export default BottomSheetChangeRole;
