@@ -3,7 +3,7 @@ import React from 'react';
3
3
import { Instance } from 'tippy.js' ;
4
4
import { useDarkMode } from '../../../context/DarkModeContext' ;
5
5
import useUserSolutionsForProblem from '../../../hooks/useUserSolutionsForProblem' ;
6
- import { isUsaco , ProblemInfo } from '../../../models/problem' ;
6
+ import { getProblemURL , isUsaco , ProblemInfo } from '../../../models/problem' ;
7
7
import TextTooltip from '../../Tooltip/TextTooltip' ;
8
8
import { DivisionProblemInfo } from './DivisionList/DivisionProblemInfo' ;
9
9
import ProblemListItemSolution from './ProblemListItemSolution' ;
@@ -61,15 +61,30 @@ export default function ProblemsListItemDropdown(
61
61
62
62
const { problem, isDivisionTable, isFocusProblem } = props ;
63
63
const darkMode = useDarkMode ( ) ;
64
- const solutionContent =
65
- isFocusProblem || isDivisionTable == true ? (
66
- < > </ >
64
+
65
+ const solutionContent = isFocusProblem ? (
66
+ < > </ >
67
+ ) : isDivisionTable ? (
68
+ props ?. problem ?. solution ?. kind == 'internal' ? (
69
+ < a
70
+ className = { `flex items-center group px-4 py-2 text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800` }
71
+ href = { `${ getProblemURL ( problem ) } /solution` }
72
+ target = "_blank"
73
+ rel = "noreferrer"
74
+ >
75
+ < div className = "text-left" >
76
+ { props . problem . solution . hasHints && 'Hints + ' } Internal Sol
77
+ </ div >
78
+ </ a >
67
79
) : (
68
- < ProblemListItemSolution
69
- problem = { props . problem }
70
- onShowSolutionSketch = { props . onShowSolutionSketch }
71
- />
72
- ) ;
80
+ < > </ >
81
+ )
82
+ ) : (
83
+ < ProblemListItemSolution
84
+ problem = { props . problem }
85
+ onShowSolutionSketch = { props . onShowSolutionSketch }
86
+ />
87
+ ) ;
73
88
74
89
const tippyRef = React . useRef < Instance > ( ) ;
75
90
const [ isDropdownShown , setIsDropdownShown ] = React . useState ( false ) ;
0 commit comments