This commit is contained in:
@@ -2,15 +2,16 @@
|
||||
|
||||
import useBattleDataStore from "@/stores/battleDataStore";
|
||||
import Image from "next/image";
|
||||
import useAvatarDataStore from "@/stores/avatarDataStore";
|
||||
import { getNameEnemy } from "@/helper/getNameChar";
|
||||
|
||||
function formatEnemyIdForURL(id?: number): string {
|
||||
const n = id ?? 0;
|
||||
const adjusted = n.toString().length === 9 ? n / 100 : n;
|
||||
return adjusted.toFixed(0);
|
||||
}
|
||||
import useLocaleStore from "@/stores/localeStore";
|
||||
import NameAvatar from "../nameAvatar";
|
||||
|
||||
export default function EnemyBar() {
|
||||
const { enemyDetail } = useBattleDataStore()
|
||||
const { listEnemy } = useAvatarDataStore()
|
||||
const { locale } = useLocaleStore()
|
||||
|
||||
return (
|
||||
<div className="p-3 w-full">
|
||||
@@ -21,16 +22,18 @@ export default function EnemyBar() {
|
||||
<div className="flex items-center justify-between mb-3">
|
||||
<div className="flex items-center gap-2">
|
||||
<Image
|
||||
src={`https://api.hakush.in/hsr/UI/monstermiddleicon/Monster_${formatEnemyIdForURL(enemy.id)}.webp`}
|
||||
src={`https://api.hakush.in/hsr/UI/monstermiddleicon/${listEnemy.find((monster) => monster.child.includes(enemy.id))?.icon?.split("/")?.pop()?.replace(".png", "")}.webp`}
|
||||
alt={enemy.name}
|
||||
width={40}
|
||||
height={40}
|
||||
className="object-cover w-10 h-10 rounded-lg"
|
||||
/>
|
||||
<div className="flex-1 min-w-0">
|
||||
<h3 className="text-base font-semibold leading-tight truncate overflow-hidden" title={enemy.name}>
|
||||
{enemy.name}
|
||||
</h3>
|
||||
<NameAvatar
|
||||
text={getNameEnemy(locale, listEnemy.find((monster) => monster.child.includes(enemy.id)))}
|
||||
locale={locale}
|
||||
className="text-base font-semibold leading-tight truncate overflow-hidden"
|
||||
/>
|
||||
<p className="text-base-content/70 text-xs">Level {enemy.level || 1}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -12,6 +12,7 @@ import { useTranslations } from "next-intl";
|
||||
import Link from "next/link";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useEffect, useState } from "react";
|
||||
import Image from "next/image";
|
||||
|
||||
const themes = [
|
||||
{ label: "Winter" },
|
||||
@@ -211,23 +212,28 @@ export default function Header() {
|
||||
{/* Logo */}
|
||||
|
||||
<a className="hidden sm:grid sm:grid-cols-1 items-start text-left gap-0 hover:scale-105 px-2">
|
||||
<h1 className="text-xl font-bold">
|
||||
<span className="text-emerald-500">Firefly Analy</span>
|
||||
<span className="bg-clip-text text-transparent bg-gradient-to-r from-emerald-400 via-orange-500 to-red-500">
|
||||
sis
|
||||
</span>
|
||||
</h1>
|
||||
<p className="text-sm text-gray-500">For Veritas</p>
|
||||
<div className="flex items-center justify-center">
|
||||
<Image src="/ff-sranalysis.png" alt="Logo" width={50} height={50} />
|
||||
<div className="flex flex-col justify-center items-start">
|
||||
<h1 className="text-xl font-bold">
|
||||
<span className="text-emerald-500">Firefly Analy</span>
|
||||
<span className="bg-clip-text text-transparent bg-gradient-to-r from-emerald-400 via-orange-500 to-red-500">
|
||||
sis
|
||||
</span>
|
||||
</h1>
|
||||
<p className="text-sm text-gray-500">For Veritas</p>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
{version && (
|
||||
<div className="px-2">
|
||||
<div className="inline-flex items-center space-x-2 px-3 py-1.5 bg-gradient-to-r from-blue-500 to-purple-600 rounded-full shadow-md hover:shadow-lg transition-all duration-200">
|
||||
<div className="w-1.5 h-1.5 bg-white rounded-full animate-pulse"></div>
|
||||
<div className="text-xs font-semibold text-white">
|
||||
{version}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="px-2">
|
||||
<div className="inline-flex items-center space-x-2 px-3 py-1.5 bg-gradient-to-r from-blue-500 to-purple-600 rounded-full shadow-md hover:shadow-lg transition-all duration-200">
|
||||
<div className="w-1.5 h-1.5 bg-white rounded-full animate-pulse"></div>
|
||||
<div className="text-xs font-semibold text-white">
|
||||
{version}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user