-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: ユーザー画面に、SubmissionとTestCasesを表示できるようにする (#257)
- Loading branch information
Showing
6 changed files
with
126 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 18 additions & 2 deletions
20
frontend/src/routes/problems/$problemId/-components/info-panel/test-cases.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,28 @@ | ||
import type { ComponentPropsWithoutRef, FC } from "react" | ||
|
||
import { Button } from "@/components/ui/button" | ||
import { cn } from "@/lib/utils" | ||
|
||
import { useProblem } from "../../-hooks/use-problem" | ||
|
||
export type TestCasesProps = ComponentPropsWithoutRef<"div"> | ||
|
||
// todo: Implement TestCases | ||
export const TestCases: FC<TestCasesProps> = ({ className, ...props }) => { | ||
const { problem } = useProblem() | ||
return ( | ||
<div className={className} {...props}> | ||
WIP: Display test cases | ||
<div className={cn("grid grid-cols-[auto_lfr_auto]", className)} {...props}> | ||
{problem.data?.test_cases.map(({ input, output }, i) => ( | ||
<Button | ||
className="col-span-2 grid grid-cols-subgrid gap-4" | ||
key={i} | ||
size="sm" | ||
variant="ghost" | ||
> | ||
<div className="text-left">入力:{input}</div> | ||
<div className="text-left">出力:{output}</div> | ||
</Button> | ||
))} | ||
</div> | ||
) | ||
} |
12 changes: 0 additions & 12 deletions
12
frontend/src/routes/problems/$problemId/-components/info-panel/test-results.tsx
This file was deleted.
Oops, something went wrong.