2022-05-12 07:05:26 +00:00
|
|
|
<script lang="ts">
|
|
|
|
import { Employee } from '@anticrm/contact'
|
|
|
|
import EmployeeStatusPresenter from './EmployeeStatusPresenter.svelte'
|
|
|
|
import PersonPresenter from '../components/PersonPresenter.svelte'
|
|
|
|
import { showPopup } from '@anticrm/ui'
|
|
|
|
import EmployeePreviewPopup from './EmployeePreviewPopup.svelte'
|
2022-05-16 05:02:40 +00:00
|
|
|
import { WithLookup } from '@anticrm/core'
|
2022-05-12 07:05:26 +00:00
|
|
|
|
2022-05-16 05:02:40 +00:00
|
|
|
export let value: WithLookup<Employee>
|
2022-05-12 07:05:26 +00:00
|
|
|
export let shouldShowAvatar: boolean = true
|
|
|
|
|
|
|
|
let container: HTMLElement
|
|
|
|
|
2022-05-14 09:47:00 +00:00
|
|
|
function onEdit () {
|
2022-05-12 07:05:26 +00:00
|
|
|
showPopup(
|
|
|
|
EmployeePreviewPopup,
|
|
|
|
{
|
2022-05-16 05:02:40 +00:00
|
|
|
employeeId: value._id
|
2022-05-12 07:05:26 +00:00
|
|
|
},
|
|
|
|
container
|
|
|
|
)
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
2022-05-13 17:31:57 +00:00
|
|
|
<div bind:this={container} class="flex-center container">
|
2022-05-12 07:05:26 +00:00
|
|
|
<div class="pr-2 over-underline">
|
|
|
|
<PersonPresenter {value} {onEdit} {shouldShowAvatar} />
|
|
|
|
</div>
|
2022-05-16 05:02:40 +00:00
|
|
|
{#if value.$lookup?.statuses?.length}
|
|
|
|
<div class="status content-color">
|
|
|
|
<EmployeeStatusPresenter employee={value} />
|
|
|
|
</div>
|
|
|
|
{/if}
|
2022-05-12 07:05:26 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
.container {
|
|
|
|
width: fit-content;
|
|
|
|
margin-bottom: 0.25rem;
|
|
|
|
}
|
|
|
|
|
|
|
|
.status {
|
|
|
|
font-weight: 400;
|
|
|
|
font-size: 0.875rem;
|
|
|
|
}
|
|
|
|
</style>
|