CustomDocument.tsx38 lines · main
| 1 | import { ExternalLink } from 'lucide-react' |
| 2 | import { Button } from 'ui' |
| 3 | |
| 4 | import { |
| 5 | ScaffoldContainer, |
| 6 | ScaffoldSection, |
| 7 | ScaffoldSectionContent, |
| 8 | ScaffoldSectionDetail, |
| 9 | } from '@/components/layouts/Scaffold' |
| 10 | import { CustomContentTypes } from '@/hooks/custom-content/CustomContent.types' |
| 11 | |
| 12 | interface CustomDocumentProps { |
| 13 | doc: CustomContentTypes['organizationLegalDocuments'][number] |
| 14 | } |
| 15 | |
| 16 | export const CustomDocument = ({ doc }: CustomDocumentProps) => { |
| 17 | return ( |
| 18 | <ScaffoldContainer id={doc.id}> |
| 19 | <ScaffoldSection className="py-12"> |
| 20 | <ScaffoldSectionDetail> |
| 21 | <p className="text-base m-0">{doc.name}</p> |
| 22 | <div className="space-y-2 text-sm text-foreground-light [&_p]:m-0"> |
| 23 | <p>{doc.description}</p> |
| 24 | </div> |
| 25 | </ScaffoldSectionDetail> |
| 26 | <ScaffoldSectionContent> |
| 27 | <div className="@lg:flex items-center justify-center h-full"> |
| 28 | <Button asChild type="default" iconRight={<ExternalLink />}> |
| 29 | <a download href={doc.action.url} target="_blank" rel="noreferrer noopener"> |
| 30 | {doc.action.text} |
| 31 | </a> |
| 32 | </Button> |
| 33 | </div> |
| 34 | </ScaffoldSectionContent> |
| 35 | </ScaffoldSection> |
| 36 | </ScaffoldContainer> |
| 37 | ) |
| 38 | } |