diff --git a/app/characters/page.tsx b/app/characters/page.tsx index 61505b5..d2ef6f3 100644 --- a/app/characters/page.tsx +++ b/app/characters/page.tsx @@ -3,6 +3,8 @@ import { useState, useEffect, useMemo } from 'react'; import { useInventoryStore } from '@/store/useInventoryStore'; +import { isKiller } from '../lib/utils'; + import shared from '../../styles/shared.module.css'; import styles from '../../styles/Characters.module.css'; @@ -19,8 +21,6 @@ const getIconUrl = (iconFilePath: string) => { type RoleFilter = 'all' | 'survivors' | 'killers'; -const isKiller = (idx: number) => idx >= 268435456; - export default function CharactersPage() { const store = useInventoryStore(); diff --git a/app/lib/utils.ts b/app/lib/utils.ts new file mode 100644 index 0000000..7462901 --- /dev/null +++ b/app/lib/utils.ts @@ -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; \ No newline at end of file