diff options
| author | nsfisis <nsfisis@gmail.com> | 2025-03-15 21:10:51 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2025-03-15 21:10:51 +0900 |
| commit | 35d1be206c6be675d92839cfa209fceb5d1b6db9 (patch) | |
| tree | 31734172b78f11272c5267bf7bae1541411ce553 /frontend/app/components/Gaming/Problem.tsx | |
| parent | 27168df997c298e871d34e58fdc726bf2e8a4954 (diff) | |
| download | phperkaigi-2025-albatross-35d1be206c6be675d92839cfa209fceb5d1b6db9.tar.gz phperkaigi-2025-albatross-35d1be206c6be675d92839cfa209fceb5d1b6db9.tar.zst phperkaigi-2025-albatross-35d1be206c6be675d92839cfa209fceb5d1b6db9.zip | |
feat(frontend): show sample code in watch page
Diffstat (limited to 'frontend/app/components/Gaming/Problem.tsx')
| -rw-r--r-- | frontend/app/components/Gaming/Problem.tsx | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/frontend/app/components/Gaming/Problem.tsx b/frontend/app/components/Gaming/Problem.tsx new file mode 100644 index 0000000..1584a5a --- /dev/null +++ b/frontend/app/components/Gaming/Problem.tsx @@ -0,0 +1,24 @@ +import BorderedContainerWithCaption from "../BorderedContainerWithCaption"; +import CodeBlock from "./CodeBlock"; + +type Props = { + title: string; + description: string; + sampleCode: string; +}; + +export default function Problem({ title, description, sampleCode }: Props) { + return ( + <div className="p-4 flex flex-col gap-4"> + <div className="text-center text-xl font-bold">{title}</div> + <BorderedContainerWithCaption caption="問題"> + <pre className="text-gray-700 whitespace-pre-wrap break-words"> + {description} + </pre> + </BorderedContainerWithCaption> + <BorderedContainerWithCaption caption="サンプルコード"> + <CodeBlock code={sampleCode} language="php" /> + </BorderedContainerWithCaption> + </div> + ); +} |
