import { ChangeDetectionStrategy, Component, computed, input, } from '@angular/core'; import { PiAvatarComponent, PiChipComponent, PiTextColorDirective, PiTextLargeDirective, PiTextWeightBoldDirective, } from '@pi/ui'; import type { Locale } from '../core/api'; import type { PublicMember } from '../core/api.types'; import type { Copy } from '../core/copy'; import { ContactCta } from './contact-cta'; import { memberLinks } from './member-card'; import { ProjectCard } from './project-card'; import { TechnologyChip } from './technology-chip'; /** * Someone in the collective, on their own address: who they are, what they * work with, and what they have worked on. * * The bio is plain text from a textarea, not HTML, so it is printed as text * with its line breaks kept rather than handed to `innerHTML`. */ @Component({ selector: 'app-member-detail', changeDetection: ChangeDetectionStrategy.OnPush, imports: [ ContactCta, PiAvatarComponent, PiChipComponent, PiTextColorDirective, PiTextLargeDirective, PiTextWeightBoldDirective, ProjectCard, TechnologyChip, ], styleUrl: './member-detail.scss', template: `

{{ copy().nav.team }}

{{ member().name }}

@if (member().headline; as headline) {

{{ headline }}

} @if (member().is_founder || !member().is_current) {
    @if (member().is_founder) {
  • } @if (!member().is_current) {
  • }
}
@if (member().bio; as bio) {

{{ bio }}

} @if ((member().projects ?? []).length > 0) {

{{ copy().member.projects }}

@for (project of member().projects; track project.id) { }
}
`, }) export class MemberDetail { readonly member = input.required(); readonly copy = input.required(); readonly locale = input.required(); protected readonly links = computed(() => memberLinks(this.member())); protected readonly since = computed(() => { const joined = this.member().joined_at; return joined ? new Intl.DateTimeFormat(this.locale(), { month: 'long', year: 'numeric', }).format(new Date(joined)) : null; }); }