feat: torrent player

This commit is contained in:
ner committed 2024-10-03 22:28:13 +03:00
1 parent f6cb8df39b
commit 0e3e50344f
5 files changed
+401

No files matched your search

@@ -0,0 +1,29 @@
import { create, InstanceProps } from 'react-modal-promise';
import { Modal } from '@/components/ui/dialog';
import { Table, TableBody, TableCaption, TableCell, TableRow } from '@/components/ui/table';
interface Props extends InstanceProps<Source> {
files: Source[];
}
const showFiles = create(({ onResolve, onReject, files }: Props) => {
return (
<Modal className='p-0 max-w-[500px]' onClose={onReject}>
<Table className='rounded-xl overflow-hidden'>
<TableCaption className='caption-top mt-2'>Choose file to play</TableCaption>
<TableBody>
{files.map((file) => (
<TableRow key={file.name} className='cursor-pointer'>
<TableCell className='p-2 cursor-pointer' onClick={() => onResolve(file)}>
{file.name}
</TableCell>
</TableRow>
))}
</TableBody>
</Table>
</Modal>
);
});
export default showFiles;