fix: resolve TS error in AboutMeContent - add CategoryKey type assertion for dynamic category access
This commit is contained in:
parent
9f06b1aa4c
commit
34243ff641
@ -15,8 +15,10 @@ const CATEGORIES = {
|
||||
"Architecture & Others": ["REST API", "TDD", "UI/UX Design", "Clean Architecture"],
|
||||
};
|
||||
|
||||
type CategoryKey = keyof typeof CATEGORIES | "Other";
|
||||
|
||||
export default function AboutMeContent({ data }: AboutMeContentProps) {
|
||||
const categorizedSkills = {
|
||||
const categorizedSkills: Record<CategoryKey, string[]> = {
|
||||
"Core Tech": [],
|
||||
"Backend & Tools": [],
|
||||
"Architecture & Others": [],
|
||||
@ -27,7 +29,7 @@ export default function AboutMeContent({ data }: AboutMeContentProps) {
|
||||
let matched = false;
|
||||
for (const [cat, skills] of Object.entries(CATEGORIES)) {
|
||||
if (skills.some((s) => skill.title.toLowerCase().includes(s.toLowerCase()))) {
|
||||
categorizedSkills[cat].push(skill.title);
|
||||
categorizedSkills[cat as CategoryKey].push(skill.title);
|
||||
matched = true;
|
||||
break;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user