import { type JSX, Show, type ValidComponent, splitProps } from "solid-js"; import { type ElementOf, Polymorphic, type PolymorphicProps, } from "../polymorphic"; import { useFileFieldItemContext } from "./file-field-item-context"; export interface FileFieldItemPreviewOptions { type: string; } export interface FileFieldItemPreviewCommonProps< T extends HTMLElement = HTMLElement, > {} export interface FileFieldItemPreviewRenderProps extends FileFieldItemPreviewCommonProps {} export type FileFieldItemPreviewProps< T extends ValidComponent | HTMLElement = HTMLElement, > = FileFieldItemPreviewOptions & Partial>>; export function FileFieldItemPreview( props: PolymorphicProps>, ) { const { file } = useFileFieldItemContext(); const [local, others] = splitProps(props as FileFieldItemPreviewProps, [ "type", ]); return ( as="div" {...others} /> ); }