@@ -30,9 +30,9 @@ import { TagFilterDropdown } from "~/components/TagFilterDropdown";
3030
3131ModuleRegistry . registerModules ( [ AllCommunityModule ] ) ;
3232
33- /* ─────────────────────────────────────────────────────────── */
34- /* Types */
35- /* ─────────────────────────────────────────────────────────── */
33+ /* ------------------------------------------------------ */
34+ /* Types */
35+ /* ------------------------------------------------------ */
3636type Difficulty = "Easy" | "Medium" | "Hard" ;
3737
3838type Problem = {
@@ -53,8 +53,9 @@ type Company = { id: number; name: string };
5353type TimeFrameTag = "six-months" | "three-months" | "thirty-days" ;
5454
5555/* ─────────────────────────────────────────────────────────── */
56- /* Constants */
57- /* ─────────────────────────────────────────────────────────── */
56+ /* ------------------------------------------------------ */
57+ /* Constants */
58+ /* ------------------------------------------------------ */
5859const DIFFICULTY_ORDER : Record < string , number > = {
5960 Easy : 0 ,
6061 Medium : 1 ,
@@ -67,9 +68,9 @@ const DIFFICULTY_STYLES: Record<string, string> = {
6768 Hard : "text-rose-500 bg-rose-500/10" ,
6869} ;
6970
70- /* ─────────────────────────────────────────────────────────── */
71- /* Helpers */
72- /* ─────────────────────────────────────────────────────────── */
71+ /* ------------------------------------------------------ */
72+ /* Helpers */
73+ /* ------------------------------------------------------ */
7374async function fetchAllCompanyProblems ( companyId : number ) {
7475 const PAGE_SIZE = 4000 ;
7576 let from = 0 ;
@@ -107,9 +108,9 @@ async function fetchAllCompanyProblems(companyId: number) {
107108 return allRows ;
108109}
109110
110- /* ─────────────────────────────────────────────────────────── */
111- /* Cell Renderers */
112- /* ─────────────────────────────────────────────────────────── */
111+ /* ------------------------------------------------------ */
112+ /* Cell Renderers */
113+ /* ------------------------------------------------------ */
113114function CompletedCellRenderer ( props : ICellRendererParams < Problem > ) {
114115 const { value, data, api } = props ;
115116
@@ -142,7 +143,7 @@ function CompletedCellRenderer(props: ICellRendererParams<Problem>) {
142143 update : [ loadingRow ] ,
143144 } ) ;
144145
145- // 👇 FORCE CELL REFRESH
146+ // FORCE CELL REFRESH
146147 api . refreshCells ( {
147148 rowNodes : [ props . node ] ,
148149 force : true ,
@@ -167,7 +168,7 @@ function CompletedCellRenderer(props: ICellRendererParams<Problem>) {
167168 if ( error ) throw error ;
168169 }
169170
170- // Success → update completed state
171+ // Success -> update completed state
171172 api . applyTransaction ( {
172173 update : [
173174 {
@@ -365,9 +366,9 @@ function OtherCompaniesCellRenderer({
365366 ) ;
366367}
367368
368- /* ─────────────────────────────────────────────────────────── */
369- /* Main Component */
370- /* ─────────────────────────────────────────────────────────── */
369+ /* ------------------------------------------------------ */
370+ /* Main Component */
371+ /* ------------------------------------------------------ */
371372export default function CompanyProblems ( ) {
372373 const { theme } = useAppContext ( ) ;
373374 const { id } = useParams < { id : string } > ( ) ;
@@ -389,7 +390,7 @@ export default function CompanyProblems() {
389390
390391 const gridRef = useRef < AgGridReact < Problem > > ( null ) ;
391392
392- /* ─── Fetch ──────────────────────────────────────────────── */
393+ /* ------------------------ Fetch ----------------------- */
393394 useEffect ( ( ) => {
394395 if ( ! companyId ) return ;
395396
@@ -479,7 +480,7 @@ export default function CompanyProblems() {
479480 fetchTags ( ) ;
480481 } , [ ] ) ;
481482
482- /* ─── Quick filter (search + difficulty) ────────────────── */
483+ /* ----------------------- Filters ---------------------- */
483484 useEffect ( ( ) => {
484485 if ( ! gridRef . current ?. api ) return ;
485486
@@ -529,8 +530,7 @@ export default function CompanyProblems() {
529530 [ diffFilter , selectedTags , tagMatchMode , hideCompleted ] ,
530531 ) ;
531532
532- /* ─── Column Definitions ────────────────────────────────── */
533-
533+ /* --------------------- Column Defs -------------------- */
534534 const columnDefs = useMemo < ColDef < Problem > [ ] > (
535535 ( ) => [
536536 {
@@ -677,13 +677,12 @@ export default function CompanyProblems() {
677677 [ ] ,
678678 ) ;
679679
680- /* ─── Stats ─────────────────────────────────────────────── */
680+ /* ------------------------ Stats ----------------------- */
681681 const easyCnt = problems . filter ( ( p ) => p . difficulty === "Easy" ) . length ;
682682 const medCnt = problems . filter ( ( p ) => p . difficulty === "Medium" ) . length ;
683683 const hardCnt = problems . filter ( ( p ) => p . difficulty === "Hard" ) . length ;
684684 const completedCnt = problems . filter ( ( p ) => p . completed ) . length ;
685685
686- /* ─── Render ─────────────────────────────────────────────── */
687686 if ( loading ) {
688687 return (
689688 < div className = "flex items-center justify-center" >
0 commit comments