PaliChapterCard.tsx 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. import { Row, Col } from "antd";
  2. import { Typography } from "antd";
  3. import TocPath from "./TocPath";
  4. const { Title, Link } = Typography;
  5. export interface IPaliChapterData {
  6. Title: string;
  7. PaliTitle: string;
  8. Path: string;
  9. Book: number;
  10. Paragraph: number;
  11. }
  12. interface IWidgetPaliChapterCard {
  13. data: IPaliChapterData;
  14. onTitleClick?: Function;
  15. }
  16. const Widget = (prop: IWidgetPaliChapterCard) => {
  17. const path = JSON.parse(prop.data.Path);
  18. return (
  19. <>
  20. <Row>
  21. <Col span={3}>封面</Col>
  22. <Col span={21}>
  23. <Row>
  24. <Col span={16}>
  25. <Row>
  26. <Col>
  27. <Title
  28. level={5}
  29. onClick={(e) => {
  30. if (typeof prop.onTitleClick !== "undefined") {
  31. prop.onTitleClick(e);
  32. }
  33. }}
  34. >
  35. <Link>{prop.data.Title}</Link>
  36. </Title>
  37. </Col>
  38. </Row>
  39. <Row>
  40. <Col>{prop.data.PaliTitle}</Col>
  41. </Row>
  42. <Row>
  43. <Col>
  44. <TocPath data={path} />
  45. </Col>
  46. </Row>
  47. </Col>
  48. <Col span={8}>进度条</Col>
  49. </Row>
  50. <Row>
  51. <Col></Col>
  52. </Row>
  53. <Row>
  54. <Col span={16}></Col>
  55. </Row>
  56. </Col>
  57. </Row>
  58. </>
  59. );
  60. };
  61. export default Widget;