diff --git a/annotation-interface/components/Label.tsx b/annotation-interface/components/Label.tsx new file mode 100644 index 000000000..588828d6b --- /dev/null +++ b/annotation-interface/components/Label.tsx @@ -0,0 +1,20 @@ +import { createElement, ElementType } from 'react'; + +interface Props extends React.HTMLAttributes { + as?: ElementType; + title: string; +} + +function Label({ as: parent, title, ...additionalProps }: Props) { + return createElement( + parent ?? 'span', + { + className: + 'border border-black border-opacity-20 text-xs px-2 rounded-full whitespace-nowrap font-semibold align-text-top mr-2', + ...additionalProps, + }, + title, + ); +} + +export default Label; diff --git a/annotation-interface/pages/bricks/index.tsx b/annotation-interface/pages/bricks/index.tsx index f4a1b49ff..1edeaace6 100644 --- a/annotation-interface/pages/bricks/index.tsx +++ b/annotation-interface/pages/bricks/index.tsx @@ -5,6 +5,7 @@ import Link from 'next/link'; import { displayCategories } from '../../common/constants'; import FilterTabs, { DisplayFilterProps } from '../../components/FilterTabs'; +import Label from '../../components/Label'; import PageHeading from '../../components/PageHeading'; import dbConnect from '../../database/connect'; import TextBrick from '../../database/models/TextBrick'; @@ -69,8 +70,9 @@ const AllTextBricks = ({ )} - + />

))}