-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
df0226d
commit 226c8f0
Showing
7 changed files
with
514 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import { type FC } from 'react'; | ||
import clsx from 'clsx'; | ||
import type { UploadedImportFile } from '@/utils/imports'; | ||
import { | ||
UPLOADED_FILE_STATUS, | ||
UPLOADED_FILE_STATUS_COLORS, | ||
UploadedFilesStatus, | ||
} from '@/utils/imports'; | ||
import { Button } from '../Button'; | ||
|
||
export const UploadedItem: FC< | ||
UploadedImportFile & { index: number; onRemove: (index: number) => void } | ||
> = (data) => ( | ||
<li className="flex items-center justify-between gap-x-6 py-5"> | ||
<div className="min-w-0"> | ||
<div className="flex items-start gap-x-3"> | ||
<p className="my-0 font-semibold leading-6 text-white"> | ||
{data.name.replaceAll('Streaming_History_Audio_', '')} | ||
</p> | ||
<div | ||
className={clsx( | ||
'my-0 flex-none rounded-md bg-foreground py-1 px-2 text-xs font-medium', | ||
UPLOADED_FILE_STATUS_COLORS[data.status] | ||
)} | ||
> | ||
{UPLOADED_FILE_STATUS[data.status]} | ||
</div> | ||
</div> | ||
<div className="mt-1 flex items-center gap-x-2 text-sm leading-5 text-gray-500"> | ||
<p className="truncate"> | ||
aprox{' '} | ||
{data.status === UploadedFilesStatus.Error | ||
? '0' | ||
: data.data.length.toLocaleString()}{' '} | ||
streams | ||
</p> | ||
</div> | ||
</div> | ||
<div className="flex flex-none gap-x-4"> | ||
<Button | ||
onClick={() => data.onRemove(data.index)} | ||
className="bg-red-500 text-white hover:bg-red-700" | ||
> | ||
Remove file | ||
</Button> | ||
</div> | ||
</li> | ||
); |
Oops, something went wrong.