import { Alert, Button, Group, Paper, Skeleton, Stack, Text, Title, } from "@mantine/core"; import type { FC, PropsWithChildren, ReactNode } from "react"; import { useTranslation } from "react-i18next"; import { LoadingSkeleton } from "@/shared/ui"; import type { SectionState } from "../model/section"; import classes from "./InstrumentDetails.module.css"; const CHART_SKELETON_HEIGHT_PX = 280; const SECTION_SKELETON_HEIGHT_PX = 65; type InstrumentSectionProps = PropsWithChildren<{ title: string; state: SectionState; controls?: ReactNode; large?: boolean; embedded?: boolean; }>; const InstrumentSection: FC = (props) => { const { t } = useTranslation(); return ( {props.title} {props.controls} {props.state.refreshing ? ( {t("accounts.refreshing")} ) : null} {props.state.error ? ( {props.state.hasData ? t("accounts.refreshError") : t("stock.sectionError")} ) : null} {props.state.loading ? ( ) : ( props.children )} ); }; export { InstrumentSection };