mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
35 lines
813 B
TypeScript
35 lines
813 B
TypeScript
![]() |
import React, { FunctionComponent } from 'react';
|
||
|
import globalize from '../../../../scripts/globalize';
|
||
|
|
||
|
const createInputElement = ({ type, id, label, options }) => ({
|
||
|
__html: `<input
|
||
|
is="emby-input"
|
||
|
type="${type}"
|
||
|
id="${id}"
|
||
|
label="${label}"
|
||
|
${options}
|
||
|
/>`
|
||
|
});
|
||
|
|
||
|
type IProps = {
|
||
|
type?: string;
|
||
|
id?: string;
|
||
|
label?: string;
|
||
|
options?: string
|
||
|
}
|
||
|
|
||
|
const InputElement: FunctionComponent<IProps> = ({ type, id, label, ...rest }: IProps) => {
|
||
|
return (
|
||
|
<div
|
||
|
dangerouslySetInnerHTML={createInputElement({
|
||
|
type: type,
|
||
|
id: id,
|
||
|
label: globalize.translate(label),
|
||
|
options: rest.options ? rest.options : ''
|
||
|
})}
|
||
|
/>
|
||
|
);
|
||
|
};
|
||
|
|
||
|
export default InputElement;
|