feat: add DLC page
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
import { DLC } from "@/lib/utils";
|
||||
|
||||
export type PlatformFilter = 'all' | 'steam' | 'epic' | 'xbox';
|
||||
|
||||
export const isOnSteam = (dlc: DLC) =>
|
||||
dlc.dlcIds.steam !== '0' && dlc.dlcIds.steam !== '-1';
|
||||
|
||||
export const isOnEpic = (dlc: DLC) =>
|
||||
dlc.dlcIds.epic !== 'FFFFFFFFFFFFFFFF' && dlc.dlcIds.epic !== '0';
|
||||
|
||||
export const isOnXbox = (dlc: DLC) =>
|
||||
dlc.dlcIds.grdk !== '9ZZZZZZZZZZZ' && dlc.dlcIds.grdk !== '0';
|
||||
|
||||
export const matchesPlatform = (dlc: DLC, filter: PlatformFilter) => {
|
||||
if (filter === 'all') return true;
|
||||
if (filter === 'steam') return isOnSteam(dlc);
|
||||
if (filter === 'epic') return isOnEpic(dlc);
|
||||
if (filter === 'xbox') return isOnXbox(dlc);
|
||||
return true;
|
||||
};
|
||||
Reference in New Issue
Block a user