| import * as React from 'react' |
| import { Box, Text } from '../../ink.js' |
| import { env } from '../../utils/env.js' |
|
|
| export type ClawdPose = |
| | 'default' |
| | 'arms-up' |
| | 'look-left' |
| | 'look-right' |
|
|
| type Props = { |
| pose?: ClawdPose |
| } |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| type Segments = { |
| |
| r1L: string |
| |
| r1E: string |
| |
| r1R: string |
| |
| r2L: string |
| |
| r2R: string |
| } |
|
|
| const POSES: Record<ClawdPose, Segments> = { |
| default: { r1L: ' β', r1E: 'βββββ', r1R: 'β', r2L: 'ββ', r2R: 'ββ' }, |
| 'look-left': { r1L: ' β', r1E: 'βββββ', r1R: 'β', r2L: 'ββ', r2R: 'ββ' }, |
| 'look-right': { r1L: ' β', r1E: 'βββββ', r1R: 'β', r2L: 'ββ', r2R: 'ββ' }, |
| 'arms-up': { r1L: 'ββ', r1E: 'βββββ', r1R: 'ββ', r2L: ' β', r2R: 'β ' }, |
| } |
|
|
| |
| |
| const APPLE_EYES: Record<ClawdPose, string> = { |
| default: ' β β ', |
| 'look-left': ' β β ', |
| 'look-right': ' β β ', |
| 'arms-up': ' β β ', |
| } |
|
|
| export function Clawd({ pose = 'default' }: Props = {}): React.ReactNode { |
| if (env.terminal === 'Apple_Terminal') { |
| return <AppleTerminalClawd pose={pose} /> |
| } |
| const p = POSES[pose] |
| return ( |
| <Box flexDirection="column"> |
| <Text> |
| <Text color="clawd_body">{p.r1L}</Text> |
| <Text color="clawd_body" backgroundColor="clawd_background"> |
| {p.r1E} |
| </Text> |
| <Text color="clawd_body">{p.r1R}</Text> |
| </Text> |
| <Text> |
| <Text color="clawd_body">{p.r2L}</Text> |
| <Text color="clawd_body" backgroundColor="clawd_background"> |
| βββββ |
| </Text> |
| <Text color="clawd_body">{p.r2R}</Text> |
| </Text> |
| <Text color="clawd_body"> |
| {' '}ββ ββ{' '} |
| </Text> |
| </Box> |
| ) |
| } |
|
|
| function AppleTerminalClawd({ pose }: { pose: ClawdPose }): React.ReactNode { |
| |
| |
| |
| return ( |
| <Box flexDirection="column" alignItems="center"> |
| <Text> |
| <Text color="clawd_body">β</Text> |
| <Text color="clawd_background" backgroundColor="clawd_body"> |
| {APPLE_EYES[pose]} |
| </Text> |
| <Text color="clawd_body">β</Text> |
| </Text> |
| <Text backgroundColor="clawd_body">{' '.repeat(7)}</Text> |
| <Text color="clawd_body">ββ ββ</Text> |
| </Box> |
| ) |
| } |
|
|