mirror of
https://github.com/He4eT/elseifplayer.git
synced 2026-05-05 01:17:22 +00:00
16 lines
360 B
JavaScript
16 lines
360 B
JavaScript
import { h } from 'preact'
|
|
|
|
export default function ({ theme, setLocation, buildLink }) {
|
|
const fileInputHandler = ({ target }) => {
|
|
const file = target.files[0]
|
|
const url = `${URL.createObjectURL(file)}#${file.name}`
|
|
|
|
setLocation(buildLink({ url, theme }))
|
|
}
|
|
|
|
return (
|
|
<input
|
|
type='file'
|
|
onChange={fileInputHandler} />
|
|
)
|
|
}
|