import { AtUri } from '@atproto/syntax' import type { Status } from '#/db/schema' import { html } from '../view' import { shell } from './shell' const STATUS_OPTIONS = [ '๐Ÿ‘', '๐Ÿ‘Ž', '๐Ÿ’™', '๐Ÿฅน', '๐Ÿ˜ง', '๐Ÿ˜ค', '๐Ÿ™ƒ', '๐Ÿ˜‰', '๐Ÿ˜Ž', '๐Ÿค“', '๐Ÿคจ', '๐Ÿฅณ', '๐Ÿ˜ญ', '๐Ÿ˜ค', '๐Ÿคฏ', '๐Ÿซก', '๐Ÿ’€', 'โœŠ', '๐Ÿค˜', '๐Ÿ‘€', '๐Ÿง ', '๐Ÿ‘ฉโ€๐Ÿ’ป', '๐Ÿง‘โ€๐Ÿ’ป', '๐Ÿฅท', '๐ŸงŒ', '๐Ÿฆ‹', '๐Ÿš€', ] type Props = { statuses: Status[] didHandleMap: Record profile?: { displayName?: string; handle: string } } export function home(props: Props) { return shell({ title: 'Home', content: content(props), }) } function content({ statuses, didHandleMap, profile }: Props) { return html`
${profile ? html`
Hi, ${profile.displayName || profile.handle}. what's your status today?
` : html`

Log in to set your status!

`}
${STATUS_OPTIONS.map( (status) => html`
${status}
` )}
๐Ÿ‘
@pfrazee.com is feeling ๐Ÿ‘ on Aug 12, 2024
๐Ÿ‘
@pfrazee.com is feeling ๐Ÿ‘ on Aug 12, 2024
๐Ÿ‘
@pfrazee.com is feeling ๐Ÿ‘ on Aug 12, 2024
๐Ÿ‘
@pfrazee.com is feeling ๐Ÿ‘ on Aug 12, 2024
๐Ÿ‘
@pfrazee.com is feeling ๐Ÿ‘ on Aug 12, 2024
๐Ÿ‘
@pfrazee.com is feeling ๐Ÿ‘ on Aug 12, 2024
${statuses.map((status, i) => { const handle = didHandleMap[status.authorDid] || status.authorDid return html`
${status.status}
@${handle} is feeling ${status.status} on ${ts(status)}
` })}
` } function toBskyLink(did: string) { return `https://bsky.app/profile/${did}` } function ts(status: Status) { const indexedAt = new Date(status.indexedAt) const updatedAt = new Date(status.updatedAt) if (updatedAt > indexedAt) return updatedAt.toDateString() return indexedAt.toDateString() }