ChapterHead.tsx 738 B

12345678910111213141516171819202122232425262728293031323334
  1. import { Typography } from "antd";
  2. import { Link } from "react-router";
  3. const { Title, Text } = Typography;
  4. export interface IChapterInfo {
  5. title: string;
  6. subTitle?: string;
  7. summary?: string;
  8. cover?: string;
  9. book?: number;
  10. para?: number;
  11. }
  12. interface IWidgetPaliChapterHeading {
  13. data: IChapterInfo;
  14. }
  15. const ChapterHeadWidget = (prop: IWidgetPaliChapterHeading) => {
  16. return (
  17. <>
  18. <Title level={4}>
  19. <Link to={`/article/chapter/${prop.data.book}-${prop.data.para}`}>
  20. {prop.data.title}
  21. </Link>
  22. </Title>
  23. <div>
  24. <Text type="secondary">
  25. {prop.data.subTitle ? prop.data.subTitle : ""}
  26. </Text>
  27. </div>
  28. </>
  29. );
  30. };
  31. export default ChapterHeadWidget;