Something went wrong. Try again.
What inspires the people who inspire you? inspiredby.social
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127---import type { AppSession } from "../lib/app-session";import { initials } from "../lib/app-session";import type { AppViewEntityDetail, EntityPageContext } from "../lib/appview";import { entityHref, portableEntityHref, publicEntityId,} from "../lib/entity-ref";
interface Props { detail: AppViewEntityDetail; session: AppSession | null; context?: EntityPageContext; entityNoun: string; relatedClass: string; relatedEmptyMessage: string;}
const { detail, session, context, entityNoun, relatedClass, relatedEmptyMessage,} = Astro.props;const appViewId = publicEntityId(detail.id);const selectorDetails = context?.selectorDetails ?? context?.selectors ?? [];const selectorCount = context?.selectorCount ?? selectorDetails.length;const relatedEntities = context?.relatedEntities ?? [];const selectorHref = (selector: (typeof selectorDetails)[number]) => selector.entityId ? entityHref(selector.entityId, selector.name) : portableEntityHref(selector.did, selector.name);---
<section class="detail-grid"> <div class="entity-notes"> <div class="notes-head"> <h2>{detail.name} inspired {selectorCount} people</h2> </div> { selectorDetails.length > 0 ? ( selectorDetails.map((selector) => ( <article class="note-card"> <a class="note-author" href={selectorHref(selector)}> {selector.avatar ? ( <img class="note-avatar" src={selector.avatar} alt="" /> ) : ( <span class="person-initial"> {initials(selector.name)} </span> )} <span> <strong>{selector.name}</strong> {selector.handle && ( <small>@{selector.handle}</small> )} </span> </a> {selector.note ? ( <blockquote>“{selector.note}”</blockquote> ) : ( <p class="note-placeholder">No public note</p> )} </article> )) ) : ( <div class="entity-empty-note"> <h3>No inspirations yet</h3> <p>No one has selected this {entityNoun} yet.</p> <a class="secondary-btn" href="/profile#add"> {session ? "Add an inspiration" : "Connect your Atmosphere account"} </a> </div> ) } </div>
<aside class="entity-aside"> <div class="aside-block"> <h3>Often selected alongside</h3> { relatedEntities.length > 0 ? ( <div class="related-stack"> {relatedEntities.map((related) => ( <a class:list={["related-card", relatedClass]} href={entityHref( related.entityId, related.name, )} > <span class="related-art"> {related.image ? ( <img src={related.image} alt="" /> ) : ( <span>{initials(related.name)}</span> )} </span> <span class="related-copy"> <strong>{related.name}</strong> <span> Shared by {related.sharedSelectorCount}{" "} {related.sharedSelectorCount === 1 ? "profile" : "profiles"} </span> </span> </a> ))} </div> ) : ( <p class="subtle tiny">{relatedEmptyMessage}</p> ) } </div> </aside></section>