From b044c0354c46eadb9f4c66565779e9cb5ce92699 Mon Sep 17 00:00:00 2001
From: physcik <mynameisgennadiy@vk.com>
Date: Thu, 23 Apr 2026 19:51:43 +0500
Subject: Weapons page

---
 front/src/Pages/Weapons.tsx | 21 ++++++++++++++++-----
 1 file changed, 16 insertions(+), 5 deletions(-)

(limited to 'front/src/Pages/Weapons.tsx')

diff --git a/front/src/Pages/Weapons.tsx b/front/src/Pages/Weapons.tsx
index f918232..4d8632c 100644
--- a/front/src/Pages/Weapons.tsx
+++ b/front/src/Pages/Weapons.tsx
@@ -3,6 +3,7 @@ import { useContext, useState } from "react";
 import { BackendURL } from "../Config";
 import { LanguageContext } from "../Locales/Context";
 import { GetLocalizedString } from "../Locales/Locales";
+import { AllowedLanguages } from "../Locales/Context";
 import { RangedWeapon } from "../Models/RangedWeapon";
 
 const RangedWeaponsURL = `${BackendURL}/weapons/ranged`;
@@ -21,12 +22,12 @@ function WeaponsIndex() {
             <h1> {GetLocalizedString("Weapons index", lang)} </h1>
         </span>
             <h2> {GetLocalizedString("Ranged weapons", lang)} </h2>
-            {generatedRangedWeaponsList(rangedWeapons)}
+            {generatedRangedWeaponsList(rangedWeapons, lang)}
         </div>
     );
 }
 
-function generatedRangedWeaponsList(rangedWeapons: RangedWeapon[] | null): any {
+function generatedRangedWeaponsList(rangedWeapons: RangedWeapon[] | null, language: AllowedLanguages): any {
     if (!rangedWeapons) {
         return (
             <div> </div>
@@ -47,8 +48,7 @@ function generatedRangedWeaponsList(rangedWeapons: RangedWeapon[] | null): any {
         const elements = categorized.get(x)?.map(w => {
             return (
             <tr key={w.Id}>
-                <td> {w.Name} </td>
-                <td> {w.WeaponType} </td>
+                <td> <a href={`/weapons/${w.Id}`}> {w.Name} </a> </td>
                 <td> {w.Accuracy} </td>
                 <td> {w.Concealability} </td>
                 <td> {w.Avaliability} </td>
@@ -63,15 +63,26 @@ function generatedRangedWeaponsList(rangedWeapons: RangedWeapon[] | null): any {
         return (
             <tbody key={x}>
                 <tr> 
-                    <td className="CategoryName"> {`${x}s`} </td> 
+                    <td colSpan={8} className="CategoryName"> {GetLocalizedString(`${x}s`, language)} </td> 
                 </tr>
                 {elements}
             </tbody>
         );
+
     });
 
     return (
         <table className="WeaponTable"> 
+        <colgroup>
+            <col width={"10%"} />
+            <col width={"2%"} />
+            <col width={"10%"} />
+            <col width={"10%"} />
+            <col width={"10%"} />
+            <col width={"2%"} />
+            <col width={"2%"} />
+            <col width={"10%"} />
+        </colgroup>
         {list} 
         </table>
     );
-- 
cgit v1.3

