1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00
jellyfin-web/src/utils/card.ts
grafixeyehero 8cbddba8fd Use enums CardShape & BaseItemKind,
Use type import for react FC,
Remove escapeHTML

Co-authored-by: Bill Thornton <thornbill@users.noreply.github.com>
2024-02-28 22:47:36 +03:00

29 lines
903 B
TypeScript

export enum CardShape {
Backdrop = 'backdrop',
BackdropOverflow = 'overflowBackdrop',
Banner = 'banner',
Portrait = 'portrait',
PortraitOverflow = 'overflowPortrait',
Square = 'square',
SquareOverflow = 'overflowSquare',
Auto = 'auto',
AutoHome = 'autohome',
AutoOverflow = 'autooverflow',
AutoVertical = 'autoVertical',
Mixed = 'mixed',
MixedSquare = 'mixedSquare',
MixedBackdrop = 'mixedBackdrop',
MixedPortrait = 'mixedPortrait',
}
export function getSquareShape(enableOverflow = true) {
return enableOverflow ? CardShape.SquareOverflow : CardShape.Square;
}
export function getBackdropShape(enableOverflow = true) {
return enableOverflow ? CardShape.BackdropOverflow : CardShape.Backdrop;
}
export function getPortraitShape(enableOverflow = true) {
return enableOverflow ? CardShape.PortraitOverflow : CardShape.Portrait;
}