import { useRecordContext } from "ra-core"; import { Avatar, AvatarFallback, AvatarImage } from "@/components/ds/ui/avatar"; import type { Company } from "../types"; export const CompanyAvatar = (props: { record?: Company; width?: 20 | 40; height?: 20 | 40; }) => { const { width = 40 } = props; const record = useRecordContext(props); if (!record) return null; const sizeClass = width !== 40 ? `w-[20px] h-[20px]` : "w-10 h-10"; return ( {record.name?.charAt(0) || "?"} ); };