diff --git a/fe/src/components/item/ItemStatusInLibrary.tsx b/fe/src/components/item/ItemStatusInLibrary.tsx new file mode 100644 index 0000000..f4ec830 --- /dev/null +++ b/fe/src/components/item/ItemStatusInLibrary.tsx @@ -0,0 +1,19 @@ +const statusIcons = { + available: "✅", + requested: "⏳", + missing: " ", +} + +interface ItemStatusInLibraryProps { + imdbId: string, +}; + +const ItemStatusInLibrary = ({}: ItemStatusInLibraryProps) => { + return ( +
+ {Object.values(statusIcons)[Math.floor(Math.random() * Object.values(statusIcons).length)]} +
+ ); +} + +export default ItemStatusInLibrary diff --git a/fe/src/components/search/SearchResultItem.tsx b/fe/src/components/search/SearchResultItem.tsx index f4097ab..1b811fb 100644 --- a/fe/src/components/search/SearchResultItem.tsx +++ b/fe/src/components/search/SearchResultItem.tsx @@ -1,3 +1,5 @@ +import ItemStatusInLibrary from "../item/ItemStatusInLibrary"; + interface SearchResultItemProps { title: string, image: string, @@ -12,12 +14,6 @@ const itemTypeIcons = { series: "📺", } -const itemStatusInLibrary = { - available: "✅", - requested: "⏳", - missing: " ", -} - // todo add link to movie if available const SearchResultItem = ({ title, @@ -41,9 +37,7 @@ const SearchResultItem = ({
{itemTypeIcons[type]}
-
- {Object.values(itemStatusInLibrary)[Math.floor(Math.random() * Object.values(itemStatusInLibrary).length)]} -
+
{year.substring(0, 4)}