refactor: change type annotations from 'any' to 'string' for improved type safety in handleCopy function and related components

This commit is contained in:
Bram Suurd
2024-10-10 22:06:15 +02:00
parent 70669ae5b4
commit 90a51fa26d
5 changed files with 5 additions and 5 deletions

View File

@@ -14,7 +14,7 @@ function CustomArrowRightIcon() {
}
export default function Page() {
const { theme, setTheme } = useTheme();
const { theme } = useTheme();
const [color, setColor] = useState("#000000");

View File

@@ -1,7 +1,7 @@
"use client";
import { useEffect, useState } from "react";
import { Card } from "./card";
import { CheckIcon, ClipboardCheck, ClipboardIcon } from "lucide-react";
import { CheckIcon, ClipboardIcon } from "lucide-react";
import { toast } from "sonner";
import { cn } from "@/lib/utils";

View File

@@ -39,7 +39,7 @@ const buttonVariants = cva(
},
);
const handleCopy = (type: string, value: any) => {
const handleCopy = (type: string, value: string) => {
navigator.clipboard.writeText(value);
let amountOfScriptsCopied = localStorage.getItem("amountOfScriptsCopied");

View File

@@ -1,7 +1,7 @@
import { ClipboardCheck } from "lucide-react";
import { toast } from "sonner";
export default function handleCopy(type: string, value: any) {
export default function handleCopy(type: string, value: string) {
navigator.clipboard.writeText(value);
toast.success(`copied ${type} to clipboard`, {

View File

@@ -5,6 +5,6 @@ export const pbBackup = new PocketBase(
process.env.NEXT_PUBLIC_POCKETBASE_URL_BACKUP,
);
export const getImageURL = (recordId: String, fileName: String) => {
export const getImageURL = (recordId: string, fileName: string) => {
return `${process.env.NEXT_PUBLIC_POCKETBASE_URL}/${recordId}/${fileName}`;
};