diff --git a/src/components/media-player.jsx b/src/components/media-player.jsx
new file mode 100644
index 0000000..7300773
--- /dev/null
+++ b/src/components/media-player.jsx
@@ -0,0 +1,24 @@
+import { Image } from '@mantine/core';
+
+const MediaPlayer = ({ file, fileId, shouldContain }) => {
+ const isImage = () => file.type.split('/')[0] === 'image';
+ return isImage() ? (
+
+ ) : (
+ <>
+
+ >
+ );
+};
+
+export default MediaPlayer;
diff --git a/src/components/select-item.jsx b/src/components/select-item.jsx
index e0b409f..4233e5d 100644
--- a/src/components/select-item.jsx
+++ b/src/components/select-item.jsx
@@ -1,5 +1,6 @@
-import { Card, Grid, Text, Image, Button, Center } from '@mantine/core';
+import { Card, Grid, Text, Button, Center } from '@mantine/core';
import { useState } from 'react';
+import MediaPlayer from './media-player';
const SelectorItem = ({ file, clickHandler }) => {
const [selected, setSelected] = useState(false);
@@ -12,14 +13,7 @@ const SelectorItem = ({ file, clickHandler }) => {
-
+
diff --git a/src/pages/files/file-view.jsx b/src/pages/files/file-view.jsx
index 6a407a3..ef05cfb 100644
--- a/src/pages/files/file-view.jsx
+++ b/src/pages/files/file-view.jsx
@@ -1,4 +1,5 @@
-import { Card, Text, Image, Button, Group } from '@mantine/core';
+import { Card, Text, Image, Button, Group, Center } from '@mantine/core';
+import MediaPlayer from '../../components/media-player';
const FileView = ({ file, onSelect, onDelete, ...props }) => {
// const deleteHandler = async () => {
@@ -13,7 +14,9 @@ const FileView = ({ file, onSelect, onDelete, ...props }) => {
return (
-
+
+
+
{file?.name ?? 'File Name'}
diff --git a/src/pages/playlist/content.jsx b/src/pages/playlist/content.jsx
index c8550cb..d7934cd 100644
--- a/src/pages/playlist/content.jsx
+++ b/src/pages/playlist/content.jsx
@@ -11,6 +11,7 @@ import setNotification from '../errors/error-notification';
import { Perm, checkPerm } from '../../tools/grant-access';
import { useAuth } from '../../tools/auth-provider';
import { parseTime } from '../../tools/timeUtil';
+import MediaPlayer from '../../components/media-player';
const Content = ({ form, playlistId, playlist }) => {
const [fileSelector, setFileSelector] = useState(false);
@@ -150,7 +151,7 @@ const Content = ({ form, playlistId, playlist }) => {
{form.getInputProps(`files.${index}.name`).value}
-
+
{
{form.getInputProps(`files.${index}.name`).value}
-
+
Display time: {parseTime(form.getInputProps(`files.${index}.seconds`).value)}
diff --git a/src/pages/playlists/playlist-view-editor.jsx b/src/pages/playlists/playlist-view-editor.jsx
index e86a39c..0b463a8 100644
--- a/src/pages/playlists/playlist-view-editor.jsx
+++ b/src/pages/playlists/playlist-view-editor.jsx
@@ -2,7 +2,7 @@ import { Button, TextInput, Group, Stack } from '@mantine/core';
import { useForm, isNotEmpty } from '@mantine/form';
import { useEffect, useState } from 'react';
import setNotification from '../errors/error-notification';
-import RoleSelector from './role-selector';
+import RoleSelector from '../roles/role-selector';
const PlaylistViewEditor = ({ item, handler, buttonText, APICall }) => {
const handleClose = (playlist) => {
@@ -72,7 +72,7 @@ const PlaylistViewEditor = ({ item, handler, buttonText, APICall }) => {
/>
-