|
|
@ -17,11 +17,12 @@ export default function Component({ service }) {
|
|
|
|
{ label: t("coinmarketcap.30days"), value: "30d" },
|
|
|
|
{ label: t("coinmarketcap.30days"), value: "30d" },
|
|
|
|
];
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
const [dateRange, setDateRange] = useState(dateRangeOptions[0].value);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const { widget } = service;
|
|
|
|
const { widget } = service;
|
|
|
|
const { symbols } = widget;
|
|
|
|
const { symbols } = widget;
|
|
|
|
const currencyCode = widget.currency ?? "USD";
|
|
|
|
const currencyCode = widget.currency ?? "USD";
|
|
|
|
|
|
|
|
const interval = widget.defaultinterval ?? dateRangeOptions[0].value;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const [dateRange, setDateRange] = useState(interval);
|
|
|
|
|
|
|
|
|
|
|
|
const { data: statsData, error: statsError } = useWidgetAPI(widget, "v1/cryptocurrency/quotes/latest", {
|
|
|
|
const { data: statsData, error: statsError } = useWidgetAPI(widget, "v1/cryptocurrency/quotes/latest", {
|
|
|
|
symbol: `${symbols.join(",")}`,
|
|
|
|
symbol: `${symbols.join(",")}`,
|
|
|
|