refactor: priority messages duplication

This commit is contained in:
Takeshi Kimata
2024-07-21 13:59:49 +09:00
parent 63df563b87
commit 74bb379c1a
16 changed files with 84 additions and 90 deletions

View File

@@ -13,6 +13,7 @@ import TestPriorityChart from './TestPriorityDonutChart';
import TestProgressBarChart from './TestProgressColumnChart';
import Config from '@/config/config';
import { useTheme } from 'next-themes';
import { PriorityMessages } from '@/types/priority';
const apiServer = Config.apiServer;
async function fetchProject(jwt: string, projectId: number) {
@@ -41,9 +42,10 @@ async function fetchProject(jwt: string, projectId: number) {
type Props = {
projectId: string;
messages: HomeMessages;
priorityMessages: PriorityMessages;
};
export function ProjectHome({ projectId, messages }: Props) {
export function ProjectHome({ projectId, messages, priorityMessages }: Props) {
const context = useContext(TokenContext);
const { theme, setTheme } = useTheme();
const [project, setProject] = useState({
@@ -134,7 +136,7 @@ export function ProjectHome({ projectId, messages }: Props) {
</div>
<div style={{ width: '30rem', height: '18rem' }}>
<h3>{messages.byPriority}</h3>
<TestPriorityChart priorityCounts={priorityCounts} messages={messages} theme={theme} />
<TestPriorityChart priorityCounts={priorityCounts} priorityMessages={priorityMessages} theme={theme} />
</div>
</div>
</div>