@@ -2,6 +2,8 @@ import { css } from "@emotion/react";
22import { type AppTheme } from "@n8v/app/theme" ;
33import { ellipsis } from "polished" ;
44
5+ import type { MediaProps } from "." ;
6+
57export const styles = {
68 actions : ( ) => css ( { justifyContent : "end" , marginTop : "auto" } ) ,
79
@@ -16,14 +18,32 @@ export const styles = {
1618 ...ellipsis ( "100%" , 3 ) ,
1719 } ) ,
1820
19- media : ( theme : AppTheme ) =>
21+ root : ( theme : AppTheme ) =>
2022 css ( {
21- height : theme . spacing ( 27 ) ,
22- overflow : "hidden" ,
23- pointerEvents : "none" ,
24- position : "relative" ,
23+ display : "flex" ,
24+ flexDirection : "column" ,
25+ height : theme . spacing ( 50 ) ,
2526 width : theme . spacing ( 40 ) ,
2627 } ) ,
28+ } ;
29+
30+ export const useMediaStyles = ( props : MediaProps ) => ( {
31+ media : ( theme : AppTheme ) =>
32+ css ( [
33+ {
34+ color : theme . palette . text . secondary ,
35+ height : theme . spacing ( 27 ) ,
36+ overflow : "hidden" ,
37+ pointerEvents : "none" ,
38+ position : "relative" ,
39+ width : theme . spacing ( 40 ) ,
40+ } ,
41+ ! props . frameUrl && {
42+ alignItems : "center" ,
43+ display : "flex" ,
44+ justifyContent : "center" ,
45+ } ,
46+ ] ) ,
2747
2848 mediaIframe : ( ) =>
2949 css ( {
@@ -36,11 +56,9 @@ export const styles = {
3656 width : "500%" ,
3757 } ) ,
3858
39- root : ( theme : AppTheme ) =>
59+ mediaNoFrame : ( theme : AppTheme ) =>
4060 css ( {
41- display : "flex" ,
42- flexDirection : "column" ,
43- height : theme . spacing ( 50 ) ,
44- width : theme . spacing ( 40 ) ,
61+ height : theme . spacing ( 10 ) ,
62+ width : theme . spacing ( 10 ) ,
4563 } ) ,
46- } ;
64+ } ) ;
0 commit comments