aboutsummaryrefslogtreecommitdiffhomepage
path: root/frontend/app/components/Gaming/Problem.tsx
blob: 1584a5aeda407cf56f9a2506c48f5cca60af7431 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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>
	);
}