mirror of
https://github.com/balzack/databag.git
synced 2025-05-04 23:45:21 +00:00
removing customization of audio label
This commit is contained in:
parent
6e0ddc1238
commit
260f08ce25
@ -8,18 +8,19 @@ import { IconX } from '@tabler/icons-react'
|
|||||||
export function AudioFile({ source, updateLabel, disabled, remove }: {source: File, updateLabel: (label: string)=>void, disabled: boolean, remove: ()=>void}) {
|
export function AudioFile({ source, updateLabel, disabled, remove }: {source: File, updateLabel: (label: string)=>void, disabled: boolean, remove: ()=>void}) {
|
||||||
const { state, actions } = useAudioFile(source);
|
const { state, actions } = useAudioFile(source);
|
||||||
|
|
||||||
const setLabel = (label: string) => {
|
useEffect(() => {
|
||||||
updateLabel(label);
|
updateLabel(state.label);
|
||||||
actions.setLabel(label);
|
}, [state.label]);
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={classes.asset}>
|
<div className={classes.asset}>
|
||||||
<Image radius="sm" className={classes.thumb} src={audio} />
|
<Image radius="sm" className={classes.thumb} src={audio} />
|
||||||
<Text className={classes.label}>{ state.label }</Text>
|
<Text className={classes.label}>{ state.label }</Text>
|
||||||
<ActionIcon className={classes.close} variant="subtle" disabled={disabled} onClick={remove}>
|
{ !disabled && (
|
||||||
<IconX />
|
<ActionIcon className={classes.close} variant="subtle" onClick={remove}>
|
||||||
</ActionIcon>
|
<IconX />
|
||||||
|
</ActionIcon>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
13418
app/client/web/yarn.lock
13418
app/client/web/yarn.lock
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user