48 lines
1.3 KiB
TypeScript
48 lines
1.3 KiB
TypeScript
import type { RiotLane, RiotQueueGroup, RiotRankFilter } from '../api/types';
|
|
|
|
export const QUEUE_GROUP_TABS: Array<{
|
|
label: string;
|
|
value: RiotQueueGroup;
|
|
}> = [
|
|
{ label: '소환사의 협곡', value: 'summoners-rift' },
|
|
{ label: '칼바람', value: 'aram' },
|
|
{ label: 'URF', value: 'urf' },
|
|
{ label: '아레나', value: 'arena' },
|
|
{ label: '내전', value: 'internal' },
|
|
];
|
|
|
|
export const RANK_FILTER_TABS: Array<{
|
|
label: string;
|
|
value: RiotRankFilter;
|
|
}> = [
|
|
{ label: '전체', value: 'all' },
|
|
{ label: '솔로랭크', value: 'solo' },
|
|
{ label: '자유랭크', value: 'flex' },
|
|
{ label: '일반', value: 'normal' },
|
|
];
|
|
|
|
export const LANE_LABELS: Record<RiotLane | string, string> = {
|
|
TOP: '탑',
|
|
JUNGLE: '정글',
|
|
MIDDLE: '미드',
|
|
BOTTOM: '원딜',
|
|
UTILITY: '서폿',
|
|
NONE: '기타',
|
|
};
|
|
|
|
const QUEUE_GROUP_VALUES = new Set<RiotQueueGroup>(
|
|
QUEUE_GROUP_TABS.map((tab) => tab.value),
|
|
);
|
|
|
|
const RANK_FILTER_VALUES = new Set<RiotRankFilter>(
|
|
RANK_FILTER_TABS.map((tab) => tab.value),
|
|
);
|
|
|
|
export function isRiotQueueGroup(value: string | null): value is RiotQueueGroup {
|
|
return Boolean(value && QUEUE_GROUP_VALUES.has(value as RiotQueueGroup));
|
|
}
|
|
|
|
export function isRiotRankFilter(value: string | null): value is RiotRankFilter {
|
|
return Boolean(value && RANK_FILTER_VALUES.has(value as RiotRankFilter));
|
|
}
|