import React from 'react';
import {
Col,
Card,
Avatar,
Row,
Descriptions,
Typography,
Space,
Tag,
Tabs,
Skeleton
} from 'antd';
import {
EditOutlined,
PhoneTwoTone,
MailTwoTone,
SyncOutlined,
LockOutlined,
} from '@ant-design/icons';
import TagList from "../../../../components/TagList";
import UpdatePasswordModal from "../../../../components/UpdatePasswordModal";
const { Title, Text } = Typography;
const { TabPane } = Tabs;
class EmployeeProfile extends React.Component {
state = {
loading: true,
showPasswordResetModal: false,
};
constructor(props) {
super(props);
}
setLoading(value) {
this.setState({ loading: value });
}
setShowPasswordUpdate(value) {
this.setState({ showPasswordResetModal: value });
}
updateProfileImage() {
showUploadDialog(
`profile_image_${this.props.element.id}_${(new Date()).getTime()}`,
'Upload Profile Image',
'profile_image',
this.props.element.id,
`profile_image_${this.props.element.id}`,
'function',
'reloadCurrentElement',
'image'
);
}
getEditButtonJsx() {
return (<>
{this.state.loading &&
} color="processing">
{this.props.adapter.gt('Edit')}
}
{!this.state.loading &&
} color="processing"
onClick={() => modJs.edit(this.props.element.id)}>
{this.props.adapter.gt('Edit')}
}
>);
}
getEditButtonJsxWithPassword() {
return (<>
{this.state.loading &&
} color="processing">
{this.props.adapter.gt('Edit')}
}
{!this.state.loading &&
} color="processing"
onClick={() => modJs.edit(this.props.element.id)}>
{this.props.adapter.gt('Edit')}
}
} color="volcano" onClick={() => this.setShowPasswordUpdate(true)}>
{this.props.adapter.gt('Update Password')}
>);
}
getUpdatePasswordButtonJsx() {
return (<>
} color="processing">
{this.props.adapter.gt('Update Password')}
>);
}
getTabViewEmployeeFilterButtonJsx(tab) {
return (
} color="processing"
onClick={() => {switchTab(tab, {employee: this.props.element.id})}}>
{this.props.adapter.gt('Edit')}
);
}
render() {
if (this.state.loading || !this.props.element) {
return
}
return (
<>
{this.setState({ showPasswordResetModal: false })}}
adapter={this.props.adapter}
/>
this.updateProfileImage()}/>
{`${this.props.element.first_name} ${this.props.element.last_name}`}
{` ${this.props.element.mobile_phone || ''}`}
{` ${this.props.element.work_email || ''}`}
{this.props.element.employee_id}
{this.props.element.nic_num}
{this.props.element.ssn_num && this.props.element.ssn_num !== '' &&
{this.props.element.ssn_num}
}
{this.props.element.birthday || ''}
{this.props.element.gender}
{this.props.element.nationality_Name}
{this.props.element.marital_status}
{this.props.element.joined_date}
{this.props.element.driving_license || ''}
{this.props.element.other_id || ''}
{`${this.props.element.address1}, ${this.props.element.address2 || ''}`}
{this.props.element.city}
{this.props.element.country_Name}
{this.props.element.postal_code}
{` ${this.props.element.home_phone || ''}`}
{` ${this.props.element.work_phone || ''}`}
{` ${this.props.element.private_email || ''}`}
{this.props.element.job_title_Name}
{this.props.element.employment_status_Name}
{this.props.element.department_Name}
{this.props.element.supervisor_Name}
item.skill_id.display}
/>
item.education_id.display}
/>
item.certification_id.display}
/>
item.language_id.display}
/>
>
)
}
}
export default EmployeeProfile;