mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-04 05:12:38 +02:00
feat: implement Zod schemas for runtime validation across various components to enhance data integrity and error handling
This commit is contained in:
parent
7ca490c740
commit
5fd872b798
6 changed files with 253 additions and 214 deletions
|
|
@ -67,6 +67,8 @@ function ImageCancelledState({ src }: { src: string }) {
|
|||
|
||||
/**
|
||||
* Parsed Image component with error handling
|
||||
* Note: Image component has built-in click handling via href/src,
|
||||
* so no additional responseActions needed.
|
||||
*/
|
||||
function ParsedImage({ result }: { result: unknown }) {
|
||||
const image = parseSerializableImage(result);
|
||||
|
|
@ -75,14 +77,6 @@ function ParsedImage({ result }: { result: unknown }) {
|
|||
<Image
|
||||
{...image}
|
||||
maxWidth="420px"
|
||||
responseActions={[
|
||||
{ id: "open", label: "Open", variant: "default" },
|
||||
]}
|
||||
onResponseAction={(id) => {
|
||||
if (id === "open" && image.src) {
|
||||
window.open(image.src, "_blank", "noopener,noreferrer");
|
||||
}
|
||||
}}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue