feat: add utils lib
This commit is contained in:
@@ -3,6 +3,8 @@
|
|||||||
import { useState, useEffect, useMemo } from 'react';
|
import { useState, useEffect, useMemo } from 'react';
|
||||||
import { useInventoryStore } from '@/store/useInventoryStore';
|
import { useInventoryStore } from '@/store/useInventoryStore';
|
||||||
|
|
||||||
|
import { isKiller } from '../lib/utils';
|
||||||
|
|
||||||
import shared from '../../styles/shared.module.css';
|
import shared from '../../styles/shared.module.css';
|
||||||
import styles from '../../styles/Characters.module.css';
|
import styles from '../../styles/Characters.module.css';
|
||||||
|
|
||||||
@@ -19,8 +21,6 @@ const getIconUrl = (iconFilePath: string) => {
|
|||||||
|
|
||||||
type RoleFilter = 'all' | 'survivors' | 'killers';
|
type RoleFilter = 'all' | 'survivors' | 'killers';
|
||||||
|
|
||||||
const isKiller = (idx: number) => idx >= 268435456;
|
|
||||||
|
|
||||||
export default function CharactersPage() {
|
export default function CharactersPage() {
|
||||||
const store = useInventoryStore();
|
const store = useInventoryStore();
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
export const getFileName = (iconFilePath: string): string => {
|
||||||
|
const base = iconFilePath.split('/').pop() ?? '';
|
||||||
|
return base.split('.')[0];
|
||||||
|
};
|
||||||
|
|
||||||
|
export const cleanFolderName = (name: string): string =>
|
||||||
|
name.replace(/[\\/:*?"<>|]/g, '_');
|
||||||
|
|
||||||
|
export const isKiller = (idx: number): boolean => idx >= 268435456;
|
||||||
Reference in New Issue
Block a user