diff --git a/src/components/Alert/Alert.tsx b/src/components/Alert/Alert.tsx new file mode 100644 index 00000000..36306c4b --- /dev/null +++ b/src/components/Alert/Alert.tsx @@ -0,0 +1,33 @@ +import { ReactNode } from 'react'; +import { twMerge } from 'tailwind-merge'; + +interface AlertProps { + type: 'note' | 'caution' | 'danger'; + className?: string; + children: ReactNode; +} + +export const Alert = ({ type, className, children }: AlertProps) => { + let borderColor: string; + switch (type) { + default: + case 'note': { + borderColor = 'border-l-cyan'; + break; + } + case 'caution': { + borderColor = 'border-l-utility-amber'; + break; + } + case 'danger': { + borderColor = 'border-l-red'; + break; + } + } + + return ( +
+ {children} +
+ ); +}; diff --git a/src/components/Downloads/DownloadLinks.tsx b/src/components/Downloads/DownloadLinks.tsx index e000ef8f..2ffb4aaa 100644 --- a/src/components/Downloads/DownloadLinks.tsx +++ b/src/components/Downloads/DownloadLinks.tsx @@ -1,31 +1,38 @@ import Link from 'next/link'; -import Button from '../Button/Button'; +import { Alert } from '../Alert/Alert'; + +interface Version { + name: string; + links: string[]; +} type DownloadProps = { - stableLink?: string, - devLink?: string, aircraft: string, - + note?: string; + versions: Version[]; } -const downloadLinks = ({ stableLink, devLink, aircraft }: DownloadProps) => ( - +const DownloadLinks = ({ versions, note, aircraft }: DownloadProps) => ( +

{aircraft}

- {stableLink && devLink ? ( - <> - - - - - - - - - - ) : ( -

Use our installer to download.

- )} - +
+ {note && {note}} + +
+ {versions.map((version) => ( +
    + {version.links.map((link, i) => ( +
  • + {`${version.name} - Part ${i + 1} of ${version.links.length}`} +
  • + ))} +
+ ))} +
+
+
); -export default downloadLinks; +export default DownloadLinks; diff --git a/src/pages/downloads/index.tsx b/src/pages/downloads/index.tsx index 4d11a049..3ad2e94e 100644 --- a/src/pages/downloads/index.tsx +++ b/src/pages/downloads/index.tsx @@ -36,13 +36,39 @@ const Downloads: NextPage = () => (

Direct Download

If you prefer a direct download, the following links are available.

-
+
+ + -