diff --git a/src/lib/components/Options/GreekExposure.svelte b/src/lib/components/Options/GreekExposure.svelte index 9bbef358..5772a094 100644 --- a/src/lib/components/Options/GreekExposure.svelte +++ b/src/lib/components/Options/GreekExposure.svelte @@ -372,15 +372,36 @@ {#if options !== null}
- {#each ["3M", "6M", "1Y"] as item} - + {#each ["3M", "6M", "1Y"] as item, index} + {#if data?.user?.tier === "Pro" || index === 0} + + {:else if data?.user?.tier !== "Pro"} + + {item} + + + {/if} {/each}
@@ -462,7 +483,7 @@ >{item?.putCallRatio?.toFixed(2)} {:else} - n/a + n/a {/if} diff --git a/src/lib/components/Options/Volatility.svelte b/src/lib/components/Options/Volatility.svelte index aae4e767..330acaab 100644 --- a/src/lib/components/Options/Volatility.svelte +++ b/src/lib/components/Options/Volatility.svelte @@ -415,15 +415,36 @@ {#if options !== null}
- {#each ["3M", "6M", "1Y"] as item} - + {#each ["3M", "6M", "1Y"] as item, index} + {#if data?.user?.tier === "Pro" || index === 0} + + {:else if data?.user?.tier !== "Pro"} + + {item} + + + {/if} {/each}
diff --git a/src/lib/components/RatingsChart.svelte b/src/lib/components/RatingsChart.svelte index b239ad68..818697ba 100644 --- a/src/lib/components/RatingsChart.svelte +++ b/src/lib/components/RatingsChart.svelte @@ -19,6 +19,7 @@ CanvasRenderer, ]); + export let data; export let symbol; export let ratingsList; export let numOfRatings = 0; @@ -57,14 +58,14 @@ } // Filter the data based on the calculated start date - const filteredData = historicalData.filter((item) => { - const itemDate = new Date(item.time); + const filteredData = historicalData?.filter((item) => { + const itemDate = new Date(item?.time); return itemDate >= startDate && itemDate <= currentDate; }); // Extract the dates and close values from the filtered data - const dates = filteredData.map((item) => item.time); - const closeValues = filteredData.map((item) => item.close); + const dates = filteredData?.map((item) => item?.time); + const closeValues = filteredData?.map((item) => item?.close); return { dates, closeValues }; } @@ -275,15 +276,35 @@ {#if historicalData?.length > 0}
- {#each ["1Y", "3Y", "5Y", "Max"] as item} - + {#each ["1Y", "3Y", "5Y", "Max"] as item, index} + {#if data?.user?.tier === "Pro" || index === 0} + + {:else if data?.user?.tier !== "Pro"} + + {item} + + + {/if} {/each}