Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion client/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<link rel="icon" type="image/svg+xml" href="" />

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

# First, let's check if client/index.html exists and read its content
cat -n client/index.html

Repository: CNPJB/trouble-tracking-system-project

Length of output: 534


🏁 Script executed:

# Search for favicon-related assets in the repository
find . -type f \( -name "*favicon*" -o -name "*.svg" -o -name "*.ico" \) | head -20

Repository: CNPJB/trouble-tracking-system-project

Length of output: 63


🏁 Script executed:

# Search for any href patterns related to favicon in the codebase
rg "favicon|rel=\"icon\"" --type html --type js --type ts

Repository: CNPJB/trouble-tracking-system-project

Length of output: 151


Remove the empty favicon href or provide an actual asset path.

At Line 5, href="" is invalid and breaks favicon loading. The suggested path /favicon.svg does not exist in the repository. Either create a favicon asset and reference it, or remove this line entirely if a favicon is not needed.

Example fix (if favicon asset will be added)
-    <link rel="icon" type="image/svg+xml" href="" />
+    <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
🧰 Tools
🪛 HTMLHint (1.9.2)

[error] 5-5: The attribute [ href ] of the tag [ link ] must have a value.

(src-not-empty)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@client/index.html` at line 5, The link tag in client/index.html has an empty
favicon href (the <link rel="icon"> element) which is invalid; either remove
that <link rel="icon"> line entirely or replace the empty href with a valid
asset path (e.g., add a favicon file to the project and set href to its path
such as /favicon.svg) so the browser can load the favicon correctly.

<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Trouble Tracking System</title>
</head>
Expand Down
10 changes: 10 additions & 0 deletions client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"jwt-decode": "^4.0.0",
"react": "^19.2.4",
"react-dom": "^19.2.4",
"react-icons": "^5.6.0",
"react-router-dom": "^7.14.0"
},
"devDependencies": {
Expand Down
Binary file added client/public/description.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/public/rmutk.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 7 additions & 7 deletions client/src/App.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* รีเซ็ตค่าเริ่มต้นพื้นฐาน */
* {
box-sizing: border-box;
margin: 0;
padding: 0;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
/* รีเซ็ตค่าเริ่มต้นพื้นฐาน */
* {
box-sizing: border-box;
margin: 0;
padding: 0;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
5 changes: 3 additions & 2 deletions client/src/App.jsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { BrowserRouter as Router, Routes, Route, Navigate } from "react-router-dom";
import { useAuth } from "./context/AuthContext.jsx";
import './App.css'

import './App.css';
// Components
import Navbar from "./components/Navbar.jsx";

// Pages
import Login from "./pages/Login.jsx";
import Dashboard from "./pages/Dashboard.jsx";
import AddIssue from "./pages/AddIssue.jsx";
import DetailTicket from './pages/DetailTicket.jsx';



Expand All @@ -33,6 +33,7 @@ function App() {
<Route path="/" element={<Dashboard />} />
<Route path="/addIssue" element={<AddIssue />} />
<Route path="*" element={<Navigate to="/" />} />
<Route path="/Ticketproblem" element={<DetailTicket />} />
</Routes>
</div>
</>
Expand Down
Binary file removed client/src/assets/hero.png
Binary file not shown.
1 change: 0 additions & 1 deletion client/src/assets/react.svg

This file was deleted.

1 change: 0 additions & 1 deletion client/src/assets/vite.svg

This file was deleted.

64 changes: 64 additions & 0 deletions client/src/components/CardFinishProblem.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
.container-card {
display: grid;
grid-template-columns: 150px 1fr;
background-color: var(--background-color-main);
box-shadow: 0 0 0, 0 0 10px;
border: solid 1px var(--tbs-green);
padding: 1rem;
transition: all 0.1s;
width: 420px;
border-radius: 10px;
flex: 0 0 420px;
gap: 1rem;
}

.main-info-card {
display: grid;
gap: 1rem;
}
.before-img-ticket img{
width: 90%;
height: auto;
}

.info-card p {
margin: 0;
color: var(--text-color-muted);
}

.text-limit {
line-height: 1.5em;
height: 3em;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
margin: 0;
}

.img-card img {
width: 150px;
height: 150px;
border-radius: 10px;
}

.container-card:hover {
box-shadow: 0 0 0, 0 0 15px var(--tbs-green);
transform: translateY(-4px);
}

@media (max-width: 430px) {
.container-card {
display: grid;
width: 320px;
flex: 0 0 320px;
grid-template-columns: 100px 1fr;
gap: 10px;

}
.img-card img{
width: 100px;
height: 100px;
}
}
39 changes: 39 additions & 0 deletions client/src/components/CardFinishProblem.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import './CardFinishProblem.css'
import { useNavigate } from 'react-router-dom';
import { StarRating } from './StarRating';

export const CardFinishProblem = ({ data }) => {
const navigate = useNavigate();

const handleClick = () => {
navigate(`/Ticketproblem?ticketId=${data.ticketId}`);
};

return (
<div className='container-card' onClick={handleClick}>
<div className="img-card">
{data.images && data.images.length > 0 ? (
<img src={data.images[0].imageUrl} alt="" />
) :(
<div className="no-image">ไม่มีรูปภาพประกอบ</div>
)}
</div>
<div className="main-info-card" key={data.id}>
<div className="info-card">
<h1 style={{ fontSize: '25px',margin: 0 }}>{data.title}</h1>
<p>โดย : {data.admin}</p>
<p>เสร็จสิ้น : {data.admin}</p>

</div>
<div className="review-card">
<StarRating rating={data?.rating || 0} />
<p className='text-limit'><img
src="description.png"
alt=""
style={{ width: '20px', height: '20px', gap: '10px' }} />{data.comment}</p>

</div>
</div>
</div>
)
}
2 changes: 1 addition & 1 deletion client/src/components/Navbar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,4 @@ const Navbar = () => {
);
};

export default Navbar;
export default Navbar;
31 changes: 31 additions & 0 deletions client/src/components/StarRating.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import React from 'react';
import { FaStar, FaStarHalfAlt, FaRegStar } from 'react-icons/fa';

export const StarRating = ({rating}) => {
const stars = Array.from({ length: 5 }, (_, index) => {

const starValue = index + 1; // ตำแหน่งดาว (1, 2, 3, 4, 5)

// ตรรกะการเช็คว่าควรโชว์ดาวแบบไหน
if (rating >= starValue) {
// 1. ถ้าคะแนนมากกว่าหรือเท่ากับตำแหน่งดาว = โชว์ดาวเต็ม
return <FaStar key={index} color="#ffc107" size={15} />;

} else if (rating >= starValue - 0.5) {
// 2. ถ้าคะแนนมี .5 เช่น ส่งมา 4.5 ตำแหน่งดาวที่ 5 จะเข้าเงื่อนไขนี้ = โชว์ครึ่งดาว
return <FaStarHalfAlt key={index} color="#ffc107" size={15} />;

} else {
// 3. นอกนั้น = โชว์ดาวเปล่า (สีเทา)
return <FaRegStar key={index} color="#e4e5e9" size={15} />;
}
});
return (
<div style={{ display: 'flex', alignItems: 'center' }}>
<span style={{ marginLeft: '1px', color: '#666' }}>{rating}</span>
{stars}
{/* (ตัวเลือกเสริม) โชว์ตัวเลขกำกับไว้ข้างหลัง */}

</div>
)
}
Loading