|
|
@ -8,24 +8,15 @@ import { QuestionsList } from '../../components/Questions/QuestionsList'; |
|
|
|
|
|
|
|
|
|
|
|
import { |
|
|
|
import { |
|
|
|
getAllQuestionGroups, |
|
|
|
getAllQuestionGroups, |
|
|
|
type QuestionGroupType, |
|
|
|
getQuestionGroupById, |
|
|
|
} from '../../lib/question-group'; |
|
|
|
} from '../../lib/question-group'; |
|
|
|
|
|
|
|
|
|
|
|
export interface Props { |
|
|
|
const { questionGroupId } = Astro.params; |
|
|
|
questionGroup: QuestionGroupType; |
|
|
|
const questionGroup = await getQuestionGroupById(questionGroupId); |
|
|
|
|
|
|
|
if (!questionGroup) { |
|
|
|
|
|
|
|
return Astro.redirect('/404'); |
|
|
|
} |
|
|
|
} |
|
|
|
export async function getStaticPaths() { |
|
|
|
|
|
|
|
const questionGroups = await getAllQuestionGroups(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return questionGroups.map((questionGroup) => { |
|
|
|
|
|
|
|
return { |
|
|
|
|
|
|
|
params: { questionGroupId: questionGroup.id }, |
|
|
|
|
|
|
|
props: { questionGroup }, |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const { questionGroup } = Astro.props; |
|
|
|
|
|
|
|
const { frontmatter } = questionGroup; |
|
|
|
const { frontmatter } = questionGroup; |
|
|
|
--- |
|
|
|
--- |
|
|
|
|
|
|
|
|
|
|
@ -38,24 +29,24 @@ const { frontmatter } = questionGroup; |
|
|
|
> |
|
|
|
> |
|
|
|
<div class='flex bg-gray-50 pb-14 pt-4 sm:pb-16 sm:pt-8'> |
|
|
|
<div class='flex bg-gray-50 pb-14 pt-4 sm:pb-16 sm:pt-8'> |
|
|
|
<div class='container !max-w-[740px]'> |
|
|
|
<div class='container !max-w-[740px]'> |
|
|
|
<div class='mb-3 sm:mb-5 mt-2 text-left sm:text-center sm:mt-8'> |
|
|
|
<div class='mb-3 mt-2 text-left sm:mb-5 sm:mt-8 sm:text-center'> |
|
|
|
<div class='mb-2 md:mb-6'> |
|
|
|
<div class='mb-2 md:mb-6'> |
|
|
|
<a |
|
|
|
<a |
|
|
|
href='/questions' |
|
|
|
href='/questions' |
|
|
|
class='group rounded-md text-sm font-medium text-gray-400 hover:text-gray-800 transition-colors duration-200' |
|
|
|
class='group rounded-md text-sm font-medium text-gray-400 transition-colors duration-200 hover:text-gray-800' |
|
|
|
> |
|
|
|
> |
|
|
|
<span |
|
|
|
<span |
|
|
|
class='inline-block transform transition-transform group-hover:translate-x-[-2px]' |
|
|
|
class='inline-block transform transition-transform group-hover:translate-x-[-2px]' |
|
|
|
> |
|
|
|
> |
|
|
|
← |
|
|
|
← |
|
|
|
</span> |
|
|
|
</span> |
|
|
|
Back to all Questions |
|
|
|
Back to all Questions |
|
|
|
</a> |
|
|
|
</a> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<h1 class='mb-1 text-2xl font-bold sm:mb-5 sm:text-5xl'> |
|
|
|
<h1 class='mb-1 text-2xl font-bold sm:mb-5 sm:text-5xl'> |
|
|
|
{frontmatter.title} |
|
|
|
{frontmatter.title} |
|
|
|
</h1> |
|
|
|
</h1> |
|
|
|
<p class='hidden sm:block text-xl text-gray-500'> |
|
|
|
<p class='hidden text-xl text-gray-500 sm:block'> |
|
|
|
{frontmatter.description} |
|
|
|
{frontmatter.description} |
|
|
|
</p> |
|
|
|
</p> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|