import type { JSX, ValidComponent } from "solid-js"; import { type ElementOf, Polymorphic, type PolymorphicProps, } from "../polymorphic"; import { useFileFieldContext } from "./file-field-context"; export interface FileFieldLabelOptions {} export interface FileFieldLabelCommonProps< T extends HTMLElement = HTMLElement, > {} export interface FileFieldLabelRenderProps extends FileFieldLabelCommonProps { for: string; } export type FileFieldLabelProps< T extends ValidComponent | HTMLElement = HTMLElement, > = FileFieldLabelOptions & Partial>>; export function FileFieldLabel( props: PolymorphicProps>, ) { const context = useFileFieldContext(); return ( as="label" for={context.inputId()} {...(props as FileFieldLabelProps)} /> ); }