summaryrefslogtreecommitdiffhomepage
path: root/packages/ui/src/components/avatar.tsx
diff options
context:
space:
mode:
authorAdam <[email protected]>2025-12-11 15:39:38 -0600
committerAdam <[email protected]>2025-12-11 15:39:41 -0600
commite149b7c1e276281b37a47997bf98d8954a4674ba (patch)
treecc860068652d24767393fec4e3ff53ad21cdda11 /packages/ui/src/components/avatar.tsx
parent55957b2ac7edab619dc447d49bb05777ff0fb044 (diff)
downloadopencode-e149b7c1e276281b37a47997bf98d8954a4674ba.tar.gz
opencode-e149b7c1e276281b37a47997bf98d8954a4674ba.zip
fix: avatar colors
Diffstat (limited to 'packages/ui/src/components/avatar.tsx')
-rw-r--r--packages/ui/src/components/avatar.tsx13
1 files changed, 12 insertions, 1 deletions
diff --git a/packages/ui/src/components/avatar.tsx b/packages/ui/src/components/avatar.tsx
index fb5798b08..ab7b0d0e2 100644
--- a/packages/ui/src/components/avatar.tsx
+++ b/packages/ui/src/components/avatar.tsx
@@ -4,11 +4,21 @@ export interface AvatarProps extends ComponentProps<"div"> {
fallback: string
src?: string
background?: string
+ foreground?: string
size?: "small" | "normal" | "large"
}
export function Avatar(props: AvatarProps) {
- const [split, rest] = splitProps(props, ["fallback", "src", "background", "size", "class", "classList", "style"])
+ const [split, rest] = splitProps(props, [
+ "fallback",
+ "src",
+ "background",
+ "foreground",
+ "size",
+ "class",
+ "classList",
+ "style",
+ ])
const src = split.src // did this so i can zero it out to test fallback
return (
<div
@@ -23,6 +33,7 @@ export function Avatar(props: AvatarProps) {
style={{
...(typeof split.style === "object" ? split.style : {}),
...(!src && split.background ? { "--avatar-bg": split.background } : {}),
+ ...(!src && split.foreground ? { "--avatar-fg": split.foreground } : {}),
}}
>
<Show when={src} fallback={split.fallback?.[0]}>