Make this have less code
This commit is contained in:
@@ -751,34 +751,18 @@ export default function RootLayout ({
|
|||||||
{getVersionInfo(v.version)?.displayName}
|
{getVersionInfo(v.version)?.displayName}
|
||||||
</p>
|
</p>
|
||||||
<div className='mt-6.25 flex items-center justify-between'>
|
<div className='mt-6.25 flex items-center justify-between'>
|
||||||
{v.failed ? (
|
{v.failed || v.queued ? (
|
||||||
<div className='flex items-center justify-between w-full'>
|
<div className='flex items-center justify-between w-full'>
|
||||||
<span className='text-red-500 inline-block text-center flex-1'>
|
<span
|
||||||
Download failed
|
className={`${
|
||||||
</span>
|
v.failed
|
||||||
<button
|
? 'text-red-500'
|
||||||
className='button btntheme3 -ml-1.25'
|
: 'text-yellow-300'
|
||||||
onClick={() => {
|
} inline-block text-center flex-1`}
|
||||||
setDownloadQueue(prev =>
|
|
||||||
prev.filter(
|
|
||||||
id => id !== v.version
|
|
||||||
)
|
|
||||||
)
|
|
||||||
setDownloadProgress(prev =>
|
|
||||||
prev.filter(
|
|
||||||
d => d.version !== v.version
|
|
||||||
)
|
|
||||||
)
|
|
||||||
}}
|
|
||||||
title='Click to remove this version from the download queue.'
|
|
||||||
>
|
>
|
||||||
Remove
|
{v.failed
|
||||||
</button>
|
? 'Download failed'
|
||||||
</div>
|
: queuePosition === 0
|
||||||
) : v.queued ? (
|
|
||||||
<div className='flex items-center justify-between w-full'>
|
|
||||||
<span className='text-yellow-500 inline-block text-center flex-1'>
|
|
||||||
{queuePosition === 0
|
|
||||||
? 'Starting soon...'
|
? 'Starting soon...'
|
||||||
: `Queued (Position ${
|
: `Queued (Position ${
|
||||||
queuePosition + 1
|
queuePosition + 1
|
||||||
@@ -803,13 +787,18 @@ export default function RootLayout ({
|
|||||||
Remove
|
Remove
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
) : v.hash_checking ? (
|
) : v.hash_checking || v.finishing ? (
|
||||||
<span className='text-blue-500 inline-block w-full text-center'>
|
<span
|
||||||
Checking hash...
|
className={`${
|
||||||
</span>
|
v.hash_checking
|
||||||
) : v.finishing ? (
|
? 'text-blue-300'
|
||||||
<span className='text-green-500 inline-block w-full text-center'>
|
: 'text-green-300'
|
||||||
Finishing...
|
} inline-block w-full text-center`}
|
||||||
|
>
|
||||||
|
{v.hash_checking
|
||||||
|
? 'Checking hash'
|
||||||
|
: 'Finishing'}
|
||||||
|
...
|
||||||
</span>
|
</span>
|
||||||
) : (
|
) : (
|
||||||
<div className='flex flex-col gap-1 w-full'>
|
<div className='flex flex-col gap-1 w-full'>
|
||||||
|
|||||||
Reference in New Issue
Block a user