- {iconSvg && (
-
- {iconSvg}
-
- )}
-
- {title && (
-
- {title}
-
- )}
-
+ {ReactDOM.createPortal(
+
{
+ if (e.key === 'Escape') {
+ typeof onCancel === 'function' && backgroundClickable
+ ? onCancel()
+ : undefined;
+ }
+ }}
+ >
+ {loadingTransitions.map(
+ ({ props, item, key }) =>
+ item && (
+
+
+
+ )
+ )}
+ {containerTransitions.map(
+ ({ props, item, key }) =>
+ item && (
+
+
+ {iconSvg && (
+
+ {iconSvg}
- {children && (
-
+ )}
+
+ {title && (
+
+ {title}
+
+ )}
+
+
+ {children && (
+
+ )}
+ {(onCancel || onOk || onSecondary || onTertiary) && (
+
+ {typeof onOk === 'function' && (
+
+ )}
+ {typeof onSecondary === 'function' && secondaryText && (
+
+ )}
+ {typeof onTertiary === 'function' && tertiaryText && (
+
)}
- {(onCancel || onOk) && (
-
- {typeof onOk === 'function' && (
-
- )}
- {typeof onCancel === 'function' && (
-
- )}
-
+ {typeof onCancel === 'function' && (
+
)}
-
- )
- )}
- ,
- document.body
- )
+
+ )}
+
+ )
+ )}
+ ,
+ document.body
)}
>
);
diff --git a/src/components/MovieDetails/index.tsx b/src/components/MovieDetails/index.tsx
index 44ee1af71..9a187d0a9 100644
--- a/src/components/MovieDetails/index.tsx
+++ b/src/components/MovieDetails/index.tsx
@@ -38,6 +38,7 @@ const messages = defineMessages({
available: 'Available',
unavailable: 'Unavailable',
request: 'Request',
+ viewrequest: 'View Request',
pending: 'Pending',
overviewunavailable: 'Overview unavailable',
});
@@ -53,13 +54,6 @@ interface SearchResult {
results: MovieResult[];
}
-enum MediaRequestStatus {
- PENDING = 1,
- APPROVED,
- DECLINED,
- AVAILABLE,
-}
-
const MovieDetails: React.FC
= ({ movie }) => {
const { hasPermission } = useUser();
const router = useRouter();
@@ -87,6 +81,11 @@ const MovieDetails: React.FC = ({ movie }) => {
return Broken?
;
}
+ console.log(MediaStatus);
+ console.log(data);
+
+ const activeRequest = data?.mediaInfo?.requests?.[0];
+
return (
= ({ movie }) => {
{(!data.mediaInfo ||
- data.mediaInfo?.status === MediaStatus.UNKNOWN) && (
+ data.mediaInfo?.status === MediaStatus.UNKNOWN ||
+ activeRequest) && (
- )}
- {data.mediaInfo?.status === MediaStatus.PENDING && (
-
- )}
- {data.mediaInfo?.status === MediaStatus.PROCESSING && (
-
- )}
- {data.mediaInfo?.status === MediaStatus.AVAILABLE && (
-
)}
-
{hasPermission(Permission.MANAGE_REQUESTS) && (