var __read = (this && this.__read) || function (o, n) {
    var m = typeof Symbol === "function" && o[Symbol.iterator];
    if (!m) return o;
    var i = m.call(o), r, ar = [], e;
    try {
        while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
    }
    catch (error) { e = { error: error }; }
    finally {
        try {
            if (r && !r.done && (m = i["return"])) m.call(i);
        }
        finally { if (e) throw e.error; }
    }
    return ar;
};
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import Profile from './Profile';
import { useState } from 'react';
import Detail from '../../pages/ProfilePage/DocDetails/Detail';
import css from './DSODoctorProfile.module.scss';
import { _cx } from 'src/utility/class';
var cx = _cx(css);
export default function DSOProfile(_a) {
    var t = _a.t, data = _a.data, isMobile = _a.isMobile, setDsoId = _a.setDsoId;
    var _b = __read(useState(-1), 2), seletectedIndex = _b[0], setSelectedIndex = _b[1];
    var dso_practice_info = data.dso_practice_info;
    var setIndex = function (i) { return setSelectedIndex(i); };
    var handleOnClick = function (i, dsoId) {
        setIndex(i);
        setDsoId(dsoId);
    };
    return (_jsx("div", { className: cx('dso-outer-wrapper'), children: _jsx(Detail, { isMobile: isMobile, id: "dso_doctors", children: _jsxs("div", { className: cx('dso-container', { isMobile: isMobile }), children: [_jsx("div", { className: cx('dso-doc-label'), children: t.dso_doc_in_practice }), _jsx("div", { className: cx('dso-doctors-container'), children: dso_practice_info.map(function (info, i) { return (_jsx("div", { className: cx('doc-card', {
                                active: i === seletectedIndex,
                            }), children: _jsx(Profile, { imgUrl: info.photo, name: info.name, info: info, index: i, selectedIndex: seletectedIndex, onClick: function (index) { return handleOnClick(index, info.location_id); }, isMobile: isMobile }) }, i)); }) })] }) }) }));
}
