69 |
70 |
71 | {TypeStyles[type!]}
72 | {title}
73 |
74 | {
75 | !variant &&
76 |
77 | setUpdateModal?.(true)} disabled={sideOpen}>
78 |
79 |
80 | deleteContent(contentId)} disabled={sideOpen}>
81 |
82 |
83 |
84 | }
85 |
86 |
87 |
88 | {tags && tags.length > 0 && (
89 | tags.map((tag) => (
90 |
94 | # {tag.title}
95 |
96 | ))
97 | )}
98 |
99 |
100 |
101 | {link && (
102 |
109 | View Content
110 |
111 | )}
112 |
113 | {createdAt && (
114 |
115 |
116 | Created At:
117 |
118 | {new Date(createdAt).toLocaleDateString()}
119 |
120 |
121 |
122 | )}
123 |
124 | {updateModal &&
125 |
setUpdateModal?.(false)}
127 | mainTitle="Update Content"
128 | initialData={{ title, type, tags, link, contentId, createdAt }}
129 | updateModal={updateModal}
130 | />
131 | }
132 |
133 | );
134 | };
135 |
136 |
137 |
138 | export default Card;
139 |
--------------------------------------------------------------------------------
/src/components/SearchBar.tsx:
--------------------------------------------------------------------------------
1 | import { useEffect, useRef, useState } from "react";
2 | import { Search } from "lucide-react";
3 | import SeachSuggestions from "./ui/SeachSuggestions";
4 | import axios from "axios";
5 | import { ContentType } from "./Card";
6 |
7 | interface SearchBarProps{
8 | contentStore: ContentType[]
9 | }
10 | const SearchBar: React.FC