"use client"; import { type ComponentPropsWithoutRef, forwardRef, type ComponentRef, } from "react"; import { useAuiState } from "@assistant-ui/store"; import { Primitive } from "../../utils/Primitive"; type PrimitiveDivProps = ComponentPropsWithoutRef; export namespace AttachmentPrimitiveThumb { export type Element = ComponentRef; export type Props = PrimitiveDivProps; } export const AttachmentPrimitiveThumb = forwardRef< AttachmentPrimitiveThumb.Element, AttachmentPrimitiveThumb.Props >((props, ref) => { const ext = useAuiState((s) => { const parts = s.attachment.name.split("."); return parts.length > 1 ? parts.pop()! : ""; }); return ( .{ext} ); }); AttachmentPrimitiveThumb.displayName = "AttachmentPrimitive.unstable_Thumb";