mirror of
https://github.com/zammad/zammad
synced 2026-05-24 09:48:36 +00:00
27 lines
721 B
TypeScript
27 lines
721 B
TypeScript
// Copyright (C) 2012-2026 Zammad Foundation, https://zammad-foundation.org/
|
|
|
|
import Default from '../CellContent/Default.vue'
|
|
import Timestamp from '../CellContent/Timestamp.vue'
|
|
import TimestampAbsolute from '../CellContent/TimestampAbsolute.vue'
|
|
|
|
import type { Component } from 'vue'
|
|
|
|
export const useCellContent = () => {
|
|
const typeComponents: Record<string, Component> = {
|
|
default: Default,
|
|
timestamp: Timestamp,
|
|
timestamp_absolute: TimestampAbsolute,
|
|
}
|
|
|
|
const getCellContentComponent = (headerType?: string) => {
|
|
if (headerType && typeComponents[headerType]) {
|
|
return typeComponents[headerType]
|
|
}
|
|
|
|
return typeComponents.default
|
|
}
|
|
|
|
return {
|
|
getCellContentComponent,
|
|
}
|
|
}
|