changed icons from text svg to file

This commit is contained in:
2025-05-04 17:17:58 +02:00
parent 1d302eb217
commit 75d1187255
12 changed files with 43 additions and 108 deletions
+6 -45
View File
@@ -26,20 +26,7 @@ export function FileActionsContainer({
onClick={() => handleDownload(fileId, fileName)}
className="flex items-center justify-center rounded-full bg-blue-500 p-2 hover:bg-blue-600"
>
<svg
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
strokeWidth={2}
stroke="currentColor"
className="h-5 w-5 text-white"
>
<path
strokeLinecap="round"
strokeLinejoin="round"
d="M4 16v2a2 2 0 002 2h12a2 2 0 002-2v-2M7 10l5 5m0 0l5-5m-5 5V3"
/>
</svg>
<img src="/icons/download.svg" alt="Download" className="w-6 h-6" />
</button>
{/* Copy URL Button */}
@@ -47,20 +34,7 @@ export function FileActionsContainer({
onClick={() => handleCopyUrl(fileUrl)}
className="flex items-center justify-center rounded-full bg-green-500 p-2 hover:bg-green-600"
>
<svg
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
strokeWidth={2}
stroke="currentColor"
className="h-5 w-5 text-white"
>
<path
strokeLinecap="round"
strokeLinejoin="round"
d="M8 9h8m-6 4h4m-7 8h10a2 2 0 002-2V7a2 2 0 00-2-2H7a2 2 0 00-2 2v12a2 2 0 002 2z"
/>
</svg>
<img src="/icons/copy.svg" alt="Copy URL" className="w-6 h-6" />
</button>
{/* Remove Button */}
@@ -68,20 +42,7 @@ export function FileActionsContainer({
onClick={() => handleRemove(fileId)}
className="flex items-center justify-center rounded-full bg-red-500 p-2 hover:bg-red-600"
>
<svg
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
strokeWidth={2}
stroke="currentColor"
className="h-5 w-5 text-white"
>
<path
strokeLinecap="round"
strokeLinejoin="round"
d="M6 18L18 6M6 6l12 12"
/>
</svg>
<img src="/icons/delete.svg" alt="Remove" className="w-6 h-6" />
</button>
</div>
);
@@ -89,13 +50,13 @@ export function FileActionsContainer({
export function FileDescriptionContainer({
fileId,
fileDescriprtion,
fileDescription,
}: {
fileId: string;
fileDescriprtion?: string;
fileDescription?: string;
}) {
const [description, setDescription] = useState(fileDescriprtion || ""); // Add state for description
const [description, setDescription] = useState(fileDescription || ""); // Add state for description
const { handleDescriptionChange } = useFileActions(() => {}, (description: string) => {
setDescription(description);
return undefined;
+8 -62
View File
@@ -6,6 +6,7 @@ import { useRouter } from "next/navigation";
import { env } from "~/env.js";
import { FilePreview } from "~/app/_components/FilePreview";
import { useFileActions } from "~/app/_components/FileActions";
import { FileActionsContainer } from "./ActionButtons";
interface FileDetails {
id: string;
@@ -13,6 +14,7 @@ interface FileDetails {
url: string;
description: string;
extension: string;
isOwner: boolean; // Indicates if the user owns the file
}
interface FileGridProps {
@@ -110,68 +112,12 @@ export default function FileGrid({ session }: FileGridProps) {
<div className="flex self-center gap-2">
{/* Download Button */}
<button
onClick={() => handleDownload(file.id, file.name)}
className="flex items-center justify-center rounded-full bg-blue-500 p-2 hover:bg-blue-600"
>
<svg
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
strokeWidth={2}
stroke="currentColor"
className="h-5 w-5 text-white"
>
<path
strokeLinecap="round"
strokeLinejoin="round"
d="M4 16v2a2 2 0 002 2h12a2 2 0 002-2v-2M7 10l5 5m0 0l5-5m-5 5V3"
/>
</svg>
</button>
{/* Copy URL Button */}
<button
onClick={() => handleCopyUrl(file.url)}
className="flex items-center justify-center rounded-full bg-green-500 p-2 hover:bg-green-600"
>
<svg
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
strokeWidth={2}
stroke="currentColor"
className="h-5 w-5 text-white"
>
<path
strokeLinecap="round"
strokeLinejoin="round"
d="M8 9h8m-6 4h4m-7 8h10a2 2 0 002-2V7a2 2 0 00-2-2H7a2 2 0 00-2 2v12a2 2 0 002 2z"
/>
</svg>
</button>
{/* Remove Button */}
<button
onClick={() => handleRemove(file.id)}
className="flex items-center justify-center rounded-full bg-red-500 p-2 hover:bg-red-600"
>
<svg
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
strokeWidth={2}
stroke="currentColor"
className="h-5 w-5 text-white"
>
<path
strokeLinecap="round"
strokeLinejoin="round"
d="M6 18L18 6M6 6l12 12"
/>
</svg>
</button>
<FileActionsContainer
fileId={file.id}
fileName={file.name}
fileUrl={file.url}
isOwner={file.isOwner}
/>
</div>
</div>
);
+1 -1
View File
@@ -6,7 +6,7 @@ export function HomeButton() {
onClick={() => (window.location.href = "/")}
className="rounded-full bg-white/10 px-4 py-2 font-semibold hover:bg-white/20"
>
Home
<img src="/icons/home.svg" alt="Home" className="w-6 h-6" />
</button>
);
}