1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00
jellyfin-web/src/components/dashboard/users/InputElement.tsx

35 lines
800 B
TypeScript
Raw Normal View History

2021-10-02 18:10:14 +03:00
import React, { FunctionComponent } from 'react';
2021-10-19 19:19:28 +03:00
import globalize from '../../../scripts/globalize';
2021-10-02 18:10:14 +03:00
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
}
2021-10-23 18:11:05 +03:00
const InputElement: FunctionComponent<IProps> = ({ type, id, label, options }: IProps) => {
2021-10-02 18:10:14 +03:00
return (
<div
dangerouslySetInnerHTML={createInputElement({
type: type,
id: id,
label: globalize.translate(label),
2021-10-23 18:11:05 +03:00
options: options ? options : ''
2021-10-02 18:10:14 +03:00
})}
/>
);
};
export default InputElement;