diff --git a/frontend/src/components/basics/SearchField.tsx b/frontend/src/components/basics/SearchField.tsx index 3f60b41..5221870 100644 --- a/frontend/src/components/basics/SearchField.tsx +++ b/frontend/src/components/basics/SearchField.tsx @@ -1,5 +1,5 @@ import { useState } from "react"; - +import SvgIcon, { Icon } from "./SvgIcon" /** * Custom search field component including a clear search functionality */ @@ -37,40 +37,18 @@ export default function SearchField({onSearchStringChanged} : SearchFieldProps){ Clears search string on click */} {/* Left icon: Looking glass */} -
- - + -
) diff --git a/frontend/src/components/basics/SvgIcon.tsx b/frontend/src/components/basics/SvgIcon.tsx new file mode 100644 index 0000000..83ac6b4 --- /dev/null +++ b/frontend/src/components/basics/SvgIcon.tsx @@ -0,0 +1,38 @@ +/** + * SVG Icon component + */ + +/** + * Enum-like const object+type definition to define icons. + * The string corresponds to the path definition of the icon + */ +export const Icon = { + LookingGlass: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z", + X: "M6 18L18 6M6 6l12 12" +} as const; + +export type Icon = typeof Icon[keyof typeof Icon]; + +type SvgIconProps = { + pathDefinition : string + icon : Icon +} + +export default function SvgIcon({icon} : SvgIconProps){ + return ( + + + + ) +} \ No newline at end of file