fix: placeholder no hardware detect (#3873)
This commit is contained in:
parent
0c78aadf1e
commit
037357e04c
@ -211,6 +211,9 @@ const Advanced = () => {
|
|||||||
saveSettings({ gpusInUse: updatedGpusInUse })
|
saveSettings({ gpusInUse: updatedGpusInUse })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const gpuSelectionPlaceHolder =
|
||||||
|
gpuList.length > 0 ? 'Select GPU' : "You don't have any compatible GPU"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handle click outside
|
* Handle click outside
|
||||||
*/
|
*/
|
||||||
@ -322,13 +325,20 @@ const Advanced = () => {
|
|||||||
<div className="relative w-full md:w-1/2" ref={setToggle}>
|
<div className="relative w-full md:w-1/2" ref={setToggle}>
|
||||||
<Input
|
<Input
|
||||||
value={selectedGpu.join() || ''}
|
value={selectedGpu.join() || ''}
|
||||||
className="w-full cursor-pointer"
|
className={twMerge(
|
||||||
|
'w-full cursor-pointer',
|
||||||
|
gpuList.length === 0 && 'pointer-events-none'
|
||||||
|
)}
|
||||||
readOnly
|
readOnly
|
||||||
placeholder=""
|
disabled={gpuList.length === 0}
|
||||||
|
placeholder={gpuSelectionPlaceHolder}
|
||||||
suffixIcon={
|
suffixIcon={
|
||||||
<ChevronDownIcon
|
<ChevronDownIcon
|
||||||
size={14}
|
size={14}
|
||||||
className={twMerge(open && 'rotate-180')}
|
className={twMerge(
|
||||||
|
gpuList.length === 0 && 'pointer-events-none',
|
||||||
|
open && 'rotate-180'
|
||||||
|
)}
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
onClick={() => setOpen(!open)}
|
onClick={() => setOpen(!open)}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user