diff --git a/public/icons/external-link.svg b/public/icons/external-link.svg new file mode 100644 index 0000000..aca4a4a --- /dev/null +++ b/public/icons/external-link.svg @@ -0,0 +1,5 @@ + + + \ No newline at end of file diff --git a/public/models/mistral.webp b/public/models/mistral.webp new file mode 100644 index 0000000..b353391 Binary files /dev/null and b/public/models/mistral.webp differ diff --git a/src/components/Cards/ModelCard/ModelCard.mdx b/src/components/Cards/ModelCard/ModelCard.mdx new file mode 100644 index 0000000..f59af58 --- /dev/null +++ b/src/components/Cards/ModelCard/ModelCard.mdx @@ -0,0 +1,13 @@ +import { Canvas, Meta, ArgTypes } from '@storybook/blocks'; + +import * as ModelCardStories from './ModelCard.stories'; + + + +# Model Card + + + +### Props Table + + \ No newline at end of file diff --git a/src/components/Cards/ModelCard/ModelCard.stories.tsx b/src/components/Cards/ModelCard/ModelCard.stories.tsx new file mode 100644 index 0000000..db0b03e --- /dev/null +++ b/src/components/Cards/ModelCard/ModelCard.stories.tsx @@ -0,0 +1,28 @@ +import type { Meta, StoryObj } from "@storybook/react"; + +import ModelCard from "."; + +const meta: Meta = { + title: "Components/Model Card", + component: ModelCard, + decorators: [ + (Story) => ( +
+ +
+ ), + ], +}; + +export default meta; + +type Story = StoryObj; + +export const Default: Story = { + args: { + icon: "/models/mistral.webp", + modelAuthor: "mistralai", + modelName: "Mistral-7B-v0.1", + externalLink: "https://huggingface.co/mistralai/Mistral-7B-v0.1", + }, +}; diff --git a/src/components/Cards/ModelCard/ModelCard.tsx b/src/components/Cards/ModelCard/ModelCard.tsx new file mode 100644 index 0000000..01fd19d --- /dev/null +++ b/src/components/Cards/ModelCard/ModelCard.tsx @@ -0,0 +1,35 @@ +import { FC } from "react"; + +interface ModelCardProps { + /** Image url for model icon */ + icon: string; + /** Model modelAuthor */ + modelAuthor: string; + /** Model name */ + modelName: string; + /** External link to model */ + externalLink?: string; +} + +const ModelCard: FC = ({ + icon, + modelAuthor, + modelName, + externalLink, +}) => ( +
+
+ {`${modelAuthor} +

+ {modelAuthor}/{modelName} +

+
+ {externalLink && ( + + Follow link + + )} +
+); + +export default ModelCard; diff --git a/src/components/Cards/ModelCard/index.ts b/src/components/Cards/ModelCard/index.ts new file mode 100644 index 0000000..35b9014 --- /dev/null +++ b/src/components/Cards/ModelCard/index.ts @@ -0,0 +1,2 @@ +import ModelCard from "./ModelCard"; +export default ModelCard; diff --git a/src/components/Select/Select.stories.tsx b/src/components/Select/Select.stories.tsx index d7f21c3..1b94b8a 100644 --- a/src/components/Select/Select.stories.tsx +++ b/src/components/Select/Select.stories.tsx @@ -20,7 +20,7 @@ type Story = StoryObj; export const Default: Story = { args: { - listTitle: "Year", + label: "Year", listItems: [ { value: "2024", diff --git a/src/components/Select/Select.tsx b/src/components/Select/Select.tsx index d9b6c9c..46359b7 100644 --- a/src/components/Select/Select.tsx +++ b/src/components/Select/Select.tsx @@ -10,17 +10,21 @@ import { } from "react-aria-components"; interface listItem { + /** List item value (used for key) */ value: string; + /** List item label */ label: string; } interface SelectProps { - listTitle?: string; + /** Select field label */ + label?: string; + /** Select field list items */ listItems: listItem[]; } -const Select: FC = ({ listTitle, listItems }) => ( +const Select: FC = ({ label, listItems }) => ( - {listTitle && } + {label && }